If $p$ is prime, $p\ne3$ then $p^2+2$ is composite I'm trying to prove that if $p$ is prime,$p\ne3$ then $p^2+2$ is composite. Here's my attempt:
Every number $p$ can be put in the form $3k+r, 0\le r \lt 3$, with $k$ an integer. When $r=0$, the number is a multiple of 3, so that leaves us with the forms $3k+1$ and $3k+2$. The first one will be even when $k$ is odd, and the second one will be even when $k$ is even. So we will see what happens for each form in the case that $k$ is even (for the first form) and $k$ is odd (for the second form):


*

*$p=3k+1$, $k$ is even


Since $k$ is even, we can write it as $k=2q$ for some $q$. Then
$p^2+2=(3(2q)+1)^2+2=(6q+1)^2+2=6^2q^2+12q+1+2=3(12q^2+4q+1)$
So $p^2+2$ is composite.


*$p=3k+2$, $k$ is odd


Then, $k$ can be written as $k=2q+1$, for some $q$. Then
$p^2+2=(3(2q+1)+2)^2+2=(6q+5)^2+2=6^2q^2+60q+25+2=3(12q^2+10q+9)$
And again, $p^2+2$ is composite.
QED
Is that a correct proof? Is not the same that comes in the answer books.

Since $(p-1)p(p+1)$ is product of three consecutive numbers it must be divisible by $3$. Since $p\ne 3$ we see that $3$ divides $p^2-1$. So $p^2+2$ is also divisible by $3$ and since it is more than $3$ it is composite. 
