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

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

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 know then 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 replace $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[p]$, so $p$ divides

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

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. Finally, the only solution is the one found in Case 1, namely $(2,1,3)$, and we verify that it fits well.

Comment from the graders: The exercise was approached by many students, but ultimately very few managed to solve it. It required combining purely arithmetic reasoning and integer comparison reasoning. Most students who submitted an attempt provided elements in one of these two directions and came significantly close to the solution.

Several students immediately eliminate the case where one of the factors can be 1. While this case is indeed impossible and the justification is very short, it still needs to be considered and justified to some extent. It is unfortunate to lose points due to overly economical writing. The same problem arises when students obtain the equation $(m-n)\left(m^{2}+m n+n^{2}-1\right)=0(\bmod p)$ and immediately deduce that $m^{2}+m n+n^{2}-1(\bmod p)$ without justifying that $m \neq n$ $(\bmod p)$.