# 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.

• Where does this particular equation come from? We could ask whether a particular Diophantine equation has a solution in primes (when finding an integral solution is hard enough), but why is that interesting? Commented May 7, 2017 at 22:40
• Well , I don't know if there is anything interesting to be found from it but I wanted to see if it can be solved using highschool olympiad mathematics.As i said many have tried but all failed so I posted it here as a last resort. Commented May 7, 2017 at 22:49
• If it's an unsolved problem in maths, I think you could be better off on MathOverflow, though I'd hardly hope for a solution on a whiff on any forum. Commented May 7, 2017 at 22:51
• you will have a prime pair solution when $1+p^2+q^6 = 0 \mod pq$
– user411780
Commented May 7, 2017 at 23:58
• @Ahmad Why is that? Commented May 8, 2017 at 7:25

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.

• Well, $(1+\frac{1}{\alpha})^8<(1+\frac{1}{255})^8<2$ is simpler... Commented May 12, 2017 at 2:36
• Such a simple solution! Me and the creator of this problem congratulate you and thank you for your help. Commented May 12, 2017 at 10:17
• Could you highlight the specific point(s) in this proof where the assumption that $p$ and (especially) $q$ are primes is used? Commented May 12, 2017 at 13:47
• I only used that $p$ is prime, when I deduced that $p$ divides $q^4-q^2+1$, and used that $q>8$, checking primes $3,5,7$ by hand, for which it was not really necessary for $q$ to be prime.
– san
Commented May 12, 2017 at 13:59
• @san, if indeed you didn't use the assumption that $q$ is prime, it might be worth pointing that out. I'm wondering if the only solutions in integers $p$ and $q$, prime or not, are $(p,q)=(1,1)$ and $(5,2)$. Commented May 12, 2017 at 20:58