## Task A-2.2.

Determine all triples of natural numbers ( $p, m, n$ ) such that $p$ is a prime number and

$$
p^{m} - n^{3} = 8
$$
## Solution.

By moving $n^{3}$ to the right side, we get the sum of cubes:

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

Since $p$ is prime, each factor on the right side must be a power of $p$:

$$
\begin{aligned}
n+2 & =p^{\alpha} \\
n^{2}-2 n+4 & =p^{\beta} .
\end{aligned}
$$

Notice that $n^{2}-2 n+4 \geqslant n+2$, which is equivalent to the statement that $n^{2}-3 n+2 \geqslant 0$, or $(n-1)(n-2) \geqslant 0$, which holds since $n$ is a natural number, so $\beta \geqslant \alpha$.

We conclude that $p^{\alpha}$ divides $n+2$ and $n^{2}-2 n+4$, and thus also divides

$$
n \cdot(n+2)-\left(n^{2}-2 n+4\right)=4 n-4
$$

and then $4 \cdot(n+2)-(4 n-4)=12$. Therefore, $p^{\alpha} \mid 12$, so $p=2$ or $p=3$.

If $p=2$, then $n+2=p^{\alpha}$ is at most 4, and since $n>0$, it follows that $n+2=4$, which indeed gives the solution $(2,4,2)$.

If $p=3$, then $n+2=p^{\alpha}$ is exactly 3, so $n+2=3$, which gives the second solution $(3,2,1)$.