Find all primes $p,q$ such that $p^3+p=q^7+q$

The following has been unanswered in art of problem solving and other forums for months.

Find all primes $p,q$ such that

$p^3+p=q^7+q$

One solution is $(5,2)$ and it has been computer checked that there is no other solution till $10^7$.

I am really curious to see a complete solution.


Assume we have another solution, so that $q\ge 3$. We know that $p(p^2+1)=q(q^2+1)(q^4-q^2+1)$. We also have $p>q^2+1$. In fact, otherwise $p\le q^2+1$ and then $$ q^7+q=p^3+p\le (q^2+1)^3+q^2+1=q^6+3q^4+4q^2+2, $$ and so $q^7< q^6+3q^4+4q^2+2< 2q^6$, which is impossible if $q\ge 3$.

Since we also have $p>q$, it follows that $p|(q^4-q^2+1)$ and so there exist a natural number $k$ such that $pk=q^4-q^2+1$. But then $$ p(p^2+1)=q(q^2+1)pk, $$ and so $p^2+1=q(q^2+1)k$. This implies $$ p^2k^2+k^2=q(q^2+1)k^3. $$ Since $p^2k^2=(q^4-q^2+1)^2$, we arrive finally at $$ (q^4-q^2+1)^2+k^2=q(q^2+1)k^3, $$ which we rewrite as $$ (q^3+q)(q^5-3q^3+6q)-8q^2+1+k^2=(q^3+q)k^3. $$ So we obtain $$ (1)\quad\qquad\qquad\qquad\qquad\qquad\qquad (q^3+q)(k^3-q^5+3q^3-6q)=k^2+1-8q^2. $$ It follows that $k^2+1\equiv 0 \mod q$.

Let $y\in\{0,1,\dots, q-1\}$ be such that $k\equiv y\mod q$.

If $y< \sqrt{q-1}$ or $q-y<\sqrt{q-1}$, then $0\le y^2<q-1$ or $q(2y-q)\le y^2<q(2y-q)+q-1$, so in particular it is impossible that $k^2\equiv y^2\equiv -1\mod q$.

Now, since $k^3\equiv -k\equiv -y\mod q$, for any $N\in\Bbb{N}$ we have $|k^3+qN|\ge \sqrt{q-1}$. So, from (1), we deduce that $$ |1+k^2-8q^2|=(q^3+q)|k^3+q(3q^2-q^4-6)|\ge (q^3+q)\sqrt{q-1}. $$ By hand one verifies that $q=3$, $q=5$ and $q=7$ are not solutions, so we can assume $q>8$, hence $q^3> 8q^2$ and so necessarily $k^2+1>8q^2$ and then $|1+k^2-8q^2|=k^2+1-8q^2<k^2$.

So we arrive at $$ k^2>q^3\sqrt{q-1}. $$ But then $k^{12}>q^{18}(q-1)^3$ and so $$ (p^2+1)^{12}=k^{12}q^{12}(q^2+1)^{12}>q^{18}(q-1)^3q^{12}(q^2+1)^{12}>q^{54}(q-1)^3. $$ On the other hand $p>10$ implies $2p^8>(p^2+1)^4$, and so $$ (p^2+1)^{12}=(p^2+1)^{8}(p^2+1)^{4}<2(p^2+1)^{8}p^8=2(p^3+p)^8=2(q^7+q)^8. $$ Putting the inequalities together, we obtain finally $$ 2(q^7+q)^8>q^{54}(q-1)^3,\quad\quad\quad\quad\quad\quad\quad(*) $$ which is impossible, since the left hand side is of order 56 and the right hand side has order 57.

$\textbf{Detailed proof that (*) is impossible:}$

Since $q>10$, we have that $q-1>\frac{9}{10}q$ and since $\left(\frac{9}{10}\right)^3>\frac 12$, we obtain $(q-1)^3>\frac{q^3}{2}$. Hence (*) implies $$ 4(q^6+1)^8>q^{49},\quad\quad\quad\quad\quad\quad\quad(**) $$

On the other hand, for any $\alpha>10^6$ we have $2\alpha^8>(\alpha+1)^8$, for example, using that $(1+\frac{1}{\alpha})^8<(1+10^{-6})^8<2$.

In particular, for $\alpha=q^6>10^6$, we have $2(q^6)^8>(q^6+1)^8$, and so from (**) we obtain $$ 8q^{48}=4(2(q^6)^8)>4(q^6+1)^8>q^{49}, $$ which is impossible, since $q>8$.

${\textbf{Note:}}$ The proof uses crucially that $p$ is prime when deducing that $p$ divides $q^4−q^2+1$. However, the condition that $q$ is prime is not needed.