6. Find all natural numbers $n$ such that the number $2^{n}+n^{2}+25$ is a cube of a prime number.
Answer: $n=6$

Solution. Let $2^{n}+n^{2}+25=p^{3}$ for some prime number $p$. Since $p>3$, $p$ is an odd prime number. Then $n$ is an even number, and $2^{n}$ gives a remainder of 1 when divided by three. If $n$ is not divisible by three, then $n^{2}$ gives a remainder of 1 when divided by three, and then $2^{n}+n^{2}+25$ is divisible by three, which is impossible. Therefore, $n$ is divisible by six and can be written as $n=6 k$. Consequently, $2^{n}+n^{2}+25=64^{k}+36 k^{2}+25>\left(4^{k}\right)^{3}$. Therefore,

$$
64^{k}+36 k^{2}+25 \geqslant\left(4^{k}+1\right)^{3}=64^{k}+3 \cdot 16^{k}+3 \cdot 4^{k}+1 .
$$

If $k \geqslant 2$, then $3 \cdot 4^{k}>25$ and $3 \cdot 16^{k} \geqslant 36 k^{2}$ (the latter follows, for example, from the easily verifiable by induction inequality $4^{k} \geqslant 6 k$). Thus, $k=1$ and $n=6$. It remains to verify that such $n$ works: $2^{6}+6^{2}+25=125=5^{3}$.