Exercise 9. Find all triplets $(m, n, p)$ of strictly positive integers, with $p$ prime, such that:

$$
\left(m^{3}+n\right)\left(n^{3}+m\right)=p^{3}
$$
## Solution to Exercise 9

First, note that if $m=n$, then $p^{3}=\left(m^{3}+m\right)^{2}$ is a perfect square, which is impossible.

Therefore, we can assume without loss of generality that $m>n$. We then know that $m^{3}+n>n^{3}+m>1$. Since the only two ways to decompose $p^{3}$ as a product of two positive integers are $p^{2} \cdot p$ and $p^{3} \cdot 1$, we have here $m^{3}+n=p^{2}$ and $n^{3}+m=p$. From this, we can substitute $m$ with $p-n^{3}$ in the first equation, to get:

$$
\left(p-n^{3}\right)^{3}+n=p^{2}
$$

By looking at this equation modulo $p$, we get $-n^{9}+n \equiv 0 \pmod{p}$, so $p$ divides

$$
n^{9}-n=n(n-1)(n+1)\left(n^{2}+1\right)\left(n^{4}+1\right)
$$

Since $p=n^{3}+m>n^{3}$, $p$ cannot divide $n, n+1$, or $n^{2}+1$. We therefore distinguish two cases. Case 1: $p$ divides $n-1$

The inequality $p>n^{3}>n-1$ then implies that $n=1$. In this case, $m^{3}+1=p^{2}=(m+1)^{2}$, so $m^{3}-m^{2}-2 m=0$, which factors into $m(m+1)(m-2)=0$. The only solution is therefore for $m=2$, which gives the triplet $(2,1,3)$.

Case 2: $p$ divides $n^{4}+1$

In this case, since $p=n^{3}+m$, $p$ also divides the linear combination $n\left(n^{3}+m\right)-\left(n^{4}+1\right)=$ $mn-1$. But then we notice that

$$
p^{3}=\left(m^{3}+n\right)\left(n^{3}+m\right)>m^{3} n^{3}
$$

Thus $p>mn>mn-1$, so $mn-1=0$. This gives $m=n=1$, so $p^{3}=4$ which is absurd. Therefore, the only solution is the one found in Case 1, namely $(2,1,3)$, and we verify that it works.

Comment from the graders: Few students submitted the problem, but the few who did propose very diverse solutions. Some managed to bring many useful elements to the solution without concluding: it is a good idea to practice writing partial solution elements, as one day during a test, this is what will need to be done for all unsolved exercises.