How do I prove this question involving primes?

122 Views Asked by At

Find, with proof, all primes $p$ for which $p^7-2018$ is the square of a prime.
I'm pretty sure that p=3 is the only number that satisfies this, but I don't know how to prove it.

2

There are 2 best solutions below

4
On BEST ANSWER

Write $$ p^7 = 2018 +q^2$$ for some prime $q$.

Say $q\ne 3$, then $q^2 \equiv_3 1$, so we have $$ p^7 = 2018 +q^2\equiv_3 2+1 \equiv_3 0 $$ so $p=3$. If $q= 3$ then $$p^7 = 2027$$ which is impossible.

4
On

if $p\equiv 0 \mod 3$ then $$p^7-2018\equiv 1 \mod 3$$ then is the solution $p=3$ if $$p\equiv 1 \mod 3$$ then $$p^7-2018 \equiv 0 \mod 3$$ if $$p\equiv 2 \mod 3$$ then $$2^7-2018 \equiv 0\mod 3$$ so the only case is $$p=3$$