
3. Determine all pairs $(p, m)$ consisting of a prime number $p$ and a positive integer $m$, for which

$$
p^{3}+m(p+2)=m^{2}+p+1
$$

holds.


3. All terms containing a factor $p$ are brought to the left-hand side of the equation. In this way we obtain $p^{3}+m p-p=m^{2}-2 m+1$, or

$$
p\left(p^{2}+m-1\right)=(m-1)^{2} .
$$

Note that $m-1$ is nonnegative by assumption. Observe that $p$ is a divisor of $(m-1)^{2}$. Since $p$ is a prime number, $p$ must also divide $m-1$. We may write $m-1=k p$, with $k$ a nonnegative integer. Substituting this into the previous equation gives: $p\left(p^{2}+k p\right)=k^{2} p^{2}$. Dividing by $p^{2}$ on both sides, we find $p+k=k^{2}$, or

$$
p=k(k-1) \text {. }
$$

As $p$ is prime, one of the factors $k$ and $k-1$ must equal 1 (the case $k-1=-1$ is excluded). The case $k=1$ does not lead to a solution because then $k-1=0$. Hence, we must have $k-1=1$, which gives the only candidate for a solution $k=2, p=2$ en $m=5$, and hence $(p, m)=(2,5)$. It is clear that this is indeed a solution.
