Problem: If $p\geq 5$ is a prime number, show that $p^2+2$ is composite.
Remarks: Now if one observes that $p$ takes the forms $6k+1$ and $6k+5$, the problem is resolved quite easily. However, if one were to choose other forms say $4k+1$ and $4k+3$ then $p^2$ would be of the form $4p+1$ which would yeild the general form $4p+3$ on addition with $2$. Obviously this does not lead to any concrete conclusion. I was wondering whether there is any specific procedure involved in finding the right quotients (For eg. $6$ and $4$) or is this just a random problem solving trick. Moreover, if anyone could provide some intuition as to why $6$ works would be much appreciated.