## Task 4.

Determine all triples of natural numbers $(m, n, p)$ where $p$ is a prime number, and the following equation holds:

$$
m^{3} + 7 p^{2} = 2^{n}
$$
## Solution.

If $p=2$, then $2^{n}>28$, so $n \geqslant 5$. Also, $m$ must be a natural number, so 8 divides $2^{n}-m^{3}=7 p^{2}=28$, which is a contradiction. Therefore, $p$ must be odd.

Cubes of natural numbers when divided by 7 give remainders $0,1,6$, while powers of two give periodic remainders $1,2,4$. Therefore, $m^{3}$ and $2^{n}$ must give a remainder of 1 when divided by 7, so $n$ must be divisible by 3. Let $n=3 k$.

Then we have

$$
7 p^{2}=2^{3 k}-m^{3}=\left(2^{k}-m\right)\left(2^{2 k}+2^{k} m+m^{2}\right)
$$

Since $p>2$ is prime and $2^{k}-m$ is 49, we have $p>7$. The remainders of $p^{2}$ when divided by 7 are 1, 4, or 2, while the possible remainders of $3 m^{2}$ when divided by 7 are $0,3,5$ and 6. Thus, there are no solutions in this case either.

If $2^{k}-m=p$, then

$$
7 p=2^{2 k}+2^{k} m+m^{2}=2^{k}(m+p)+2^{k} m+\left(2^{k}-p\right) m=3 \cdot 2^{k} m+p \cdot 2^{k}-p m=3 \cdot 2^{k} m+p^{2}
$$

We see that $7 p=3 \cdot 2^{k} m+p^{2}>p^{2}$, so $p<7$. We have already eliminated the possibility $p=2$. If $p=5$, then $3 \cdot 2^{k} m=7 p-p^{2}=10$, which is impossible.

If $p=3$, then $3 \cdot 2^{k} m=7 p-p^{2}=12$, i.e., we have two possibilities: $k=1, m=2$ or $k=2, m=1$. The first pair does not satisfy the initial equation $\left(2^{3}+7 \cdot 3^{2} \neq 2^{3}\right)$, while the second satisfies $\left(1^{3}+7 \cdot 3^{2}=64=2^{6}\right)$. Thus, we have found the only solution $(1,6,3)$.