## Task A-4.4.

Determine all prime numbers $p$ for which there exist exactly five natural numbers $n$ such that $n+p \mid n^{3}+p^{2}$.
## First Solution.

The sum of cubes $n^{3}+p^{3}=(n+p)\left(n^{2}-n p+p^{2}\right)$ is divisible by $n+p$. Since, according to the problem's condition, $n^{3}+p^{2}$ is divisible by $n+p$, it is equivalent to say that

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

is divisible by $n+p$.

Assume there exist $n$ and $p$ such that $n+p \mid p^{2}(p-1)$ and $n$ is not divisible by $p$. Then $n$ and $p$ are relatively prime, and therefore $n+p$ and $p$ are also relatively prime.

Thus, it must be true that $n+p \mid p-1$, which is impossible since $n+p > p-1 > 0$. Therefore, $n$ must be divisible by $p$.

We conclude that there exists $k \in \mathbb{N}$ such that $n=k p$. Finding all prime $p$ for which there exist five natural numbers from the problem's condition is equivalent to finding all prime $p$ for which there exist five natural numbers $k$ such that

$$
k+1 \mid p(p-1)
$$

The number $k$ satisfies this condition if and only if it is of the form $d-1$, where $d$ is a divisor of $p(p-1)$ greater than 1. Since 1 is a divisor of every number, we need to find all $p$ for which the expression $p(p-1)$ has exactly 6 natural divisors.

It is easy to see that $p$ cannot be equal to 2 or 3, and that $p=5$ is a solution because the number $p(p-1)=20$ has six divisors.

1 point

Now assume that $p \geqslant 7$. Then $p-1=2 m$ for some natural $m \geqslant 3$. In this case, the number $p(p-1)=2 m(2 m+1)$ has at least eight different divisors:

$$
1,2, m, 2 m, 2 m+1,2(2 m+1), m(2 m+1), 2 m(m+1)
$$

so for $p \geqslant 7$ we do not get new solutions.

We conclude that $p=5$ is the only prime number that satisfies the problem's condition.