## Task 4.

Determine all natural numbers $n$ for which there exist natural numbers $a$ and $b$ such that

$$
\left(n^{2}+2\right)^{a}=(2 n-1)^{b}
$$
## Solution.

Notice that $n^{2}+2 \geqslant 3, n^{2}+2>2 n-1$ and that $n^{2}+2$ and $2 n-1$ have the same prime factors. Let $p$ be a prime factor of $n^{2}+2$ and $2 n-1$. Then

$$
p \mid n^{2}+2 \quad \text { and } \quad p|2 n-1 \Longrightarrow p|\left(n^{2}+2\right)+(2 n-1)=(n+1)^{2} \Longrightarrow p \mid n+1
$$

However, we now see that $p \mid 2(n+1)-(2 n-1)=3$ so we conclude that $p=3$. Therefore, there exist $k, m \in \mathbb{N}, k>m$, such that $n^{2}+2=3^{k}$ and $2 n-1=3^{m}$. We calculate

$$
4 \cdot 3^{k}=4 n^{2}+8=\left(3^{m}+1\right)^{2}+8=3^{2 m}+2 \cdot 3^{m}+9
$$

so $3^{m}$ divides 9, i.e., $m \leqslant 2$. We have two possibilities:

- If $m=1$, it would have to be $2 n-1=3$, i.e., $n=2$ and $3^{k}=6$, which is impossible.
- If $m=2$, then $2 n-1=9$, i.e., $n=5$ and $k=3$.

Therefore, $n=5$ is the only such natural number.