TITLE: Prove that $2^p+p^2$ is prime for $p=3$ only
QUESTION [10 upvotes]: I do know that all prime numbers larger than $3$ can be expressed as $3k + 1$ and or $3k + 2$. Plugging those in I still see no solution.
EDIT: $p$ can only be a prime number.

REPLY [2 votes]: From Fermat's little theorem, it follows that $2^p \equiv 2 \pmod p$. Then $2^p + p^2 \equiv 2 \pmod p$... oops, that doesn't help, never mind.
Oh, wait a minute: since $2 = 3 - 1$, then $p^2 \equiv 1 \pmod 3$ by Fermat's little theorem. That means $p^2$ is of the form $3k + 1$.
So as long as $2^p \not \equiv 2 \pmod 3$, the number $2^p + p^2$ has a shot at being prime. However, since $2^2 \equiv 1 \pmod 3$ but $2^3 \equiv 2 \pmod 3$, it follows that the powers of $2$ alternate $2, 1 \pmod n$ according to whether $n$ is odd or even. But since $p > 2$ is odd, it follows that $2^p \equiv 2 \pmod 3$. Therefore, with $p > 3$ odd, $2^p + p^2$ must be a multiple of $3$.
And the only prime multiples of $3$ are $3$ itself and $-3$. So it is only with $p = 3$ that we have $2^3 + 3^2 = 17$.

Just as an amusing aside: given $p = -3$, we have $$2^p + p^2 = \frac{73}{8}.$$