Find all prime numbers $p$ and all positive integers $n$, such that $n^8 - n^2 = p^5 + p^2$
Problem
Source: IX International Festival of Young Mathematicians Sozopol, Theme for 10-12 grade
Tags: number theory, prime numbers
22.09.2018 22:37
Clearly, $n\geq 2$. For $n=2$, we have $p^2(p^3+1)=252=2^2\cdot 3^2 \cdot 7$. In particular, this gives $p=3$, thus $(n,p)=(2,3)$. Now note that both sides of the equation are strictly increasing, so we may assume $n\geq 3$ and $p>3$. Now suppose that $n\geq 3$. We have the factorization, $n^2(n-1)(n+1)(n^2-n+1)(n^2+n+1)=p^2(p^3+1)$. Case 1 If $p\mid n$, then $p\leq n$. We also have, $p^3+1\leq n^3+1$, and therefore, $p^2(p^3+1)=(n^3-1)n^2(n^3+1)\leq n^2(n^3+1)$, giving that $n^3-1\leq 1$, a contradiction. Case 2 Similarly, if $p\mid n-1$, we have a similar contradiction. If $p\mid n+1$, then unless $n+1=p$, we have $p\leq n$, and a similar contradiction can be established. If $p=n+1$, then $n\equiv -1\pmod{p}$. Now with this, $n^2(n-1)\equiv -2\pmod{p}$, $n^2-n+1\equiv 3\pmod{p}$, and $n^2+n+1\equiv 1\pmod{p}$, hence, $p^2\nmid n^8-n^2$. Therefore, this case is also done. Case 3 Now we suppose $n\not\equiv 0,-1,1\pmod{p}$. Note that, if $d=(n^2+n+1,n^2-n+1)$, then $d\mid 2n$ and $(d,2)=1$ (since $n^2-n+1$ is odd). Hence, $d\mid n$, but this would give $d\mid 1$, hence either $p^2\mid n^2-n+1$ or $p^2\mid n^2+n+1$. If the latter is true, then $p^2\leq n^2+n+1<(n+1)^2 \implies p\leq n$. But with this, $p^2-p+1\leq n^2-n+1$, $p+1\leq n+1$, $p^2\leq n^2+n+1$, and therefore, we have extra $n^2(n-1)$ on the side of the equation with $n^8-n^2$, a contradiction. The former can also be handled similarly, concluding both the case, as well as the problem.