Problem: Let $p$ and $p^2 + 2$ are prime numbers. Show that $p^3 + 2$ is also a prime number.
Solution: Note that if $p\neq 3$, then by Fermat's little theorem we have
\[
p^2 \equiv 1 (\text{ mod } 3) \implies p^2 + 2 \equiv 0 (\text{ mod } 3).
\]
So for a prime $p$ the number $p^2 + 2$ will be prime if and only if $p = 3$. Note that for $p = 3$,
\[
p^3 + 2 = 29,
\]
which is a prime number. Hence, if $p$ and $p^2 + 2$ are prime numbers, $p^3 + 2$ will also be prime.