# If $p$ is a prime then $p^2+26$ is not a prime [duplicate]

This question is an exact duplicate of:

I have tested for all primes less than $40,000$ and it seems that, if $p$ is a prime then $p^2+26$ is not. I would like to see a proof or a counter-example.

## marked as duplicate by Bill Dubuque 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(); } ); }); }); Mar 4 '17 at 21:57

This question was marked as an exact duplicate of an existing question.

If $x$ is not divisible by $3$, then $x^2 \equiv 1\mod3$. So for the primes we have
$$p^2+26\equiv 0\mod3$$
As user236182 noted, we should separately treat the case of $p = 3$, because in this case my reasons are not valid. For this prime we have $p^2+26 = 35$, which is not prime.
• Except when $p=3$. Then $35=5\cdot 7$ is still not prime. – user236182 Mar 4 '17 at 21:36
• And also $p^2+26>3$. – user236182 Mar 4 '17 at 21:37
For primes $p > 3$, 3 divides the quantity $p^2 - 1$ (proof provided here), so for some integer $n$, $$3n = p^2 - 1$$ and $$p^2 + 26 = (p^2 - 1) + 27 = 3n + 27 = 3(n+9)$$ Since 3 does not divide any primes greater than 3, and by observation $p^2 + 26$ is not prime for $p \le 3$, we can conclude that $p^2 + 26$ is composite.