Let $p$ be a prime number for which also $p^2+2$ is a prime. Show that then $p^3+2$ is also a prime.
Computing few first primes I got:
$p=2$: $2^2+2=6$ (not satisfying the condition)
$p=3$: $3^2+2=11$ (satisfying the condition)
$p=5$: $5^2+2=27$ (not satisfying the condition)
$p=7$: $7^2+2=51$ (not satisfying the condition)
so I would have a reason to believe that only the case $p=3$ will satisfy this condition, but how would I go about showing this rigorously?
The only number satisfying this condition is $3$, for all other prime numbers we have: $$p \equiv \pm 1\pmod 3 \Rightarrow p^2 + 2 \equiv 0\pmod 3,$$ and therefore $p^2 + 2$ is not a prime number.