Find all triplets $(m, n, p)$ of positive integers with $p$ prime such that $\left(m^{3}+n\right)\left(n^{3}+m\right)=$ $p^{3}$.
If $m=n$, we have $p^{3}=\left(m^{3}+m\right)^{2}$, so $p$ is a perfect square, which is impossible. Therefore, we can assume that $m>n$. If $n=0$, we have $m^{4}=p^{3}$, which is also impossible.

This means that $m^{3}+n=p^{2}$ and $n^{3}+m=p$. From this, we get $m=p-n^{3}$ and then $\left(p-n^{3}\right)^{3}+n=p^{2}$. We expand and obtain $p \mid n^{9}-n=n(n-1)(n+1)\left(n^{2}+1\right)\left(n^{4}+1\right)$. Since $p>n^{3}$, we have either $n^{9}-n=0$, and then $n=1$, or $p \mid n^{4}+1$.

1. If $n=1$, then $m=p-1$, so $(p-1)^{3}+1=p^{2}$. We deduce that $p=3$ and $m=2$.
2. If $n>1$ and $p \mid n^{4}+1$, then $p \mid n\left(n^{3}+m\right)-\left(n^{4}+1\right)=m n-1$. However, $p^{2}=m^{3}+n \geqslant 2 \sqrt{m^{3} n} \geqslant 2 m n$, which is a contradiction.

Thus, the solution triplets are $(m, n, p)=(2,1,3),(1,2,3)$.