TITLE: If $p$ and $p^2+8$ are both prime numbers, then $p^3+4$ is prime.
QUESTION [10 upvotes]: In the book, "Elementary Number Theory - 6th Edition" written by David M. Burton, I have a question. The problem is
If $p$ and $p^2+8$ are both prime numbers, prove that $p^3+4$ is also prime.
(p. 58 problem 3.3 #20)
I don't know how to prove this.
Thank you very much if you solve this question.

REPLY [2 votes]: Suppose $p^3+4$ is not prime and note that for $p=2$, $p^2+8$ is not prime and for $p\neq2$ $(p,p^3+4)=1$ which implies that $p=3$ or $p=5$ by Euclidean Algorithm.
If $p=3$ then $p^2+8=17$ and $p^3+4=31$ is prime.
If $p=5$ then $p^2+8=33$ is not prime.
Therefore $p^3+4$ is prime.