4. Problem: Determine all prime numbers $p$ such that $p^{2}-6$ and $p^{2}+6$ are both prime numbers.
Solution: If $p>5$ then the units digit of $p$ must be $1,3,7$ or 9 .
- If the units digit of $p$ is 1 or 9 then the units digit of $p^{2}$ is 1 . Therefore the units digit of $p^{2}-6$ is 5 . Since $p^{2}-6>5$ this means that $p^{2}-6$ is not prime.
- If the units digit of $p$ is 3 or 7 then the units digit of $p^{2}$ is 9 . Therefore the units digit of $p^{2}+6$ is 5 . Since $p^{2}+6>5$ this means that $p^{2}+6$ is not prime.

Therefore we must have $p \leq 5$. Hence $p$ must be 2,3 or 5 .
- If $p=2$ then $p^{2}+6=10$ is not prime.
- If $p=3$ then $p^{2}+6=15$ is not prime.
- If $p=5$ then $p^{2} \pm 6$ are 19 and 31 which are both prime.

Therefore the only answer is $p=5$.
Alternative Solution: Consider the following product modulo 5 .
$$
p\left(p^{2}-6\right)\left(p^{2}+6\right)=p^{5}-36 p \equiv p^{5}-p(\bmod 5)
$$

By Fermat's Little Theorem, this product is $0(\bmod 5)$. So if $p, p^{2}-6$ and $p^{2}+6$ are all prime numbers then at least one of them must be equal to 5 .
- If $p=5$ then $6 p^{2}-1=29$ and $6 p^{2}+1=31$. This is one solution.
- If $6 p^{2}-1=5$ then $p= \pm 1$. Neither 1 nor -1 is prime, so this case leads to no solutions.
- If $6 p^{2}+1=5$ then $p$ is not an integer. No solutions in this case.

Therefore the only solution is $p=5$.