# A question about primes, number theory [duplicate]

I tried to solve this question but without a success: Let $p$ be a prime number,and $p^2+2$ is also prime, prove that $p=3$.

I tried to show $p^2+2$ as a product of numbers and then to show that $p=3$ is the only option that allows it to be prime. but I didn't find that presentation.

I would like to get help with this question, thanks

## marked as duplicate by lab bhattacharjee elementary-number-theory StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Apr 18 '15 at 13:23

• Hint: All primes except for $2$ and $3$ are of the form $6n\pm1$. – Lucian Apr 18 '15 at 12:50

if $p$ is not $3$ then $\gcd(p,3)=1$ so $3$ divides $(p-1)(p+1)$ hence $3$ divides $p^2-1+3=p^2+2$ so $p^2+2$ is not a prime