# Only prime number for $p^2+2$ to be prime as well [closed]

Prove that the only prime number $p$ for $p^2+2$ to be prime as well is $p=3$

## closed as off-topic by Pragabhava, suomynonA, Cameron Williams, Leucippus, TravisJOct 21 '16 at 2:39

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question is missing context or other details: Please improve the question by providing additional context, which ideally includes your thoughts on the problem and any attempts you have made to solve it. This information helps others identify where you have difficulties and helps them write answers appropriate to your experience level." – Pragabhava, suomynonA, Cameron Williams, Leucippus, TravisJ
If this question can be reworded to fit the rules in the help center, please edit the question.

• $p^2\equiv1\pmod 3$ – JonMark Perry Oct 21 '16 at 12:05

If $p\neq 3$ then it has form $3k\pm 1$ so $p^2+2=(3k\pm 1)^2+2=9k^2\pm6k+3=3(3k^2\pm 2k+1)$ so wont be prime
• Why hasn't it got a form $3k \pm 2$ as well? – Bernard M. Oct 20 '16 at 15:45
• @BernardM.: Notice that $3k+2 = 3(k+1) - 1$ and $3k-2 = 3(k-1) + 1$, so the formula $3k \pm 1$ covers all the cases different from $3k$. – Alex M. Oct 20 '16 at 15:53
hint: If $q = p^2 + 2$ is a prime number, then $p = 3k+1$ or $p = 3k+2$
• I believe that you meant to use $\ne$ instead of $=$. – Alex M. Oct 20 '16 at 15:47