Why does $p^2+8$ prime imply $p^3+4$ prime

How do I prove that $p^2+8$ prime implies that $p^3+4$ is prime? What is the general pattern of thought for these problems?


If prime $p\ne 3,p$ can be written as $3k\pm1$ where $k$ is a positive integer.

So, $p^2+8=(3k\pm1)^2+8=3(3k^2\pm2k+3)$ is divisible by $3$ and $>3$ hence composite.

So, we are left with only one prime value of $p,$ i..e, $3$

More generally, $p^2+3m-1$ is composite for any positive integers $m$ and $3\not\mid p$

When we have found $3$ can be only value of prime $p,$ we can have umpteen prime numbers like $p^3+4,p^3+10,p^3-2,\cdots, p^4\pm2,\cdots $


The question or (at least the current revision) does not say that $p$ is prime. Although this is very probably the intended meaning. (The letter $p$ is typically used to denote prime numbers. Exactly this exercise with the assumption the $p$ is a prime number appears in many introductory texts in number theory.)

If we take the question in the way it is stated, i.e., we are asking whether $p^2+8$ being prime necessarily implies $p^3+4$ being prime, then the claim is not true.

The arguments in the other answers show us that if want to find a counterexample, it is possible only with $p$ being odd multiple of $3$. And indeed we can find a counterexample: $$\begin{align} 15^2+8&=233\\ 15^3+4&=3379 \end{align} $$ 233 is a prime number, but 3379 is not a prime, in fact we get the factorization $3379=31\cdot109$.