# Find all numbers $p$ such that both $p$ and $p^2+14$ are primes.

Find all numbers $p$ such that both $p, \ p^2+14$ are primes.

I believe only $p= 3$ works.

How do I prove this using the complete set of residues Modulo 3. Would something like this work.

Assume $\mathbb F = \{p, \ p+1, \ p+2 \}$ be the set of complete residues in $\mathbb Z/3 \mathbb Z$, then one of the elements of $\mathbb F$ is a zero. Meaning it is a multiple of $3$. This cannot be $p+1$ because then $p$ would equal $2$ and $4+14$ is a composite integer. Same for $p+2$ as $p = 1$ is not a prime. Hence $p = 3$.

I am still unsatisfied with this proof.

• Commented Nov 13, 2013 at 6:57

If the number $k$ is not a multiple of $3$, then $k=3n\pm 1$ for some $n$, and $$k^2=9n^2\pm6n+1=3(3n^2\pm2n)+1=3m+1$$ for some $m$, that is, $k^2\equiv1\pmod 3$ if $3$ does nor divide $k$, so $k^2+14\equiv 0\pmod 3$. In particular, if $3$ does not divide $p$, then $3$ divides $p^2+14>3$, so $p^2+14$ is not a prime.
On the other hand, if $p=3$, then $p^2+14=23$ is prime as well, so $p=3$ is the only solution.