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 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.

  • $\begingroup$ Except when $p=3$. Then $35=5\cdot 7$ is still not prime. $\endgroup$ – user236182 Mar 4 '17 at 21:36
  • $\begingroup$ And also $p^2+26>3$. $\endgroup$ – 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.


Not the answer you're looking for? Browse other questions tagged or ask your own question.