3. Determine all pairs of natural numbers $(x, n)$ that are solutions to the equation

$$
x^{3}+2 x+1=2^{n}
$$

Time for work 270 minutes.

Each task is worth 7 points.

## SERBIAN MATHEMATICAL OLYMPIAD

competition of high school students in mathematics

Belgrade, 03.04.2007.

## Second day
3. It is verified that for $n \leqslant 2$, the only solution is the pair $(1,2)$. We will prove that for $n \geqslant 3$ there are no solutions.

The number $x$ must be odd, so $x^{2}+2 \equiv 3(\bmod 8)$. From $x\left(x^{2}+2\right) \equiv-1$ $(\bmod 8)$ it follows that $x \equiv 5(\bmod 8)$. Furthermore, since $3 \mid x\left(x^{2}+2\right)$ (if $3 \nmid x$ then $\left.3 \mid x^{2}+2\right)$, it must be that $2^{n} \equiv 1(\bmod 3)$, so $n$ is an even number.

By adding 2 to both sides of the equation, we get

$$
(x+1)\left(x^{2}-x+3\right)=2^{n}+2
$$

Since $n$ is even, $2^{n}$ is a perfect square, so the number -2 is a quadratic residue modulo any odd prime divisor $p$ of the number $(x+1)\left(x^{2}-x+3\right)$. Therefore,

$$
1=\left(\frac{-2}{p}\right)=\left(\frac{-1}{p}\right)\left(\frac{2}{p}\right)=(-1)^{\frac{p-1}{2}}(-1)^{\frac{p^{2}-1}{8}}=(-1)^{\frac{(p-1)(p+5)}{8}}
$$

from which it follows that $p$ is of the form $8 k+1$ or $8 k+3$. Since the product of such prime numbers, and the number $x^{2}-x+3$ itself, must be of this form. However, since $x \equiv 5(\bmod 8)$, we have $x^{2}-x+3 \equiv 7(\bmod 8)$, which is a contradiction.

Therefore, the only solution to the given equation is $(x, n)=(1,2)$.