Task 5. Determine all pairs $(m, n)$ of positive integers for which

$$
(m+n)^{3} \mid 2 n\left(3 m^{2}+n^{2}\right)+8 .
$$
Solution. Suppose that the quotient of $2 n\left(3 m^{2}+n^{2}\right)+8$ and $(m+n)^{3}$ is not equal to 1. Then it is at least 2, so we have

$$
(m+n)^{3} \leq n\left(3 m^{2}+n^{2}\right)+4,
$$

or equivalently,

$$
m^{3}+3 m^{2} n+3 m n^{2}+n^{3} \leq 3 m^{2} n+n^{3}+4
$$

or equivalently,

$$
m^{3}+3 m n^{2} \leq 4
$$

From this, it immediately follows that $m<2$, so $m=1$. Then we have $1+3 n^{2} \leq 4$, so also $n=1$. The pair $(m, n)=(1,1)$ is indeed a solution, as $2^{3} \mid 2 \cdot 4+8$.

The other possibility is that the quotient is exactly 1. Then we have

$$
(m+n)^{3}=2 n\left(3 m^{2}+n^{2}\right)+8,
$$

or equivalently,

$$
m^{3}+3 m^{2} n+3 m n^{2}+n^{3}=6 m^{2} n+2 n^{3}+8,
$$

or equivalently,

$$
m^{3}-3 m^{2} n+3 m n^{2}-n^{3}=8 .
$$

The left side can be factored as $(m-n)^{3}$. So we have $m-n=2$, or equivalently, $m=n+2$. From the previous calculations, it follows directly that $(m, n)=(n+2, n)$ is indeed a solution for all positive integers $n$.

We conclude that the solutions are: $(m, n)=(1,1)$ and $(m, n)=(n+2, n)$ for $n \geq 1$.