## Task A-3.4.

Determine all ordered pairs $(a, b)$ of natural numbers for which $\left(a+b^{2}\right)\left(a^{2}+b\right)$ is a power of 2.
## Solution.

Since $\left(a+b^{2}\right)\left(a^{2}+b\right)$ is a power of 2, we conclude that both numbers $a+b^{2}$ and $a^{2}+b$ are powers of 2. Notice that both of these numbers are at least 2, so there exist natural numbers $m$ and $n$ such that $a+b^{2}=2^{m}$ and $a^{2}+b=2^{n}$.

Since the number $a+b^{2}$ is even, we conclude that the numbers $a$ and $b$ have the same parity.

Without loss of generality, assume that $a \leqslant b$, which means that $n \leqslant m$.

We calculate

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

Since $a$ and $b$ have the same parity, we conclude that the number $b+a-1$ is odd.

This means that $2^{n}$ divides $b-a$, and since $2^{n}=a^{2}+b$, we conclude that the number $a^{2}+b$ is a divisor of $b-a$.

If $b-a>0$, then $a^{2}+b \leqslant b-a$, which is a contradiction.

Therefore, $a=b$, which means that $a^{2}+a=a(a+1)$ is a power of 2.

Finally, both numbers $a$ and $a+1$ are powers of 2, which is only possible if $a=1$. Thus, the only solution is $(a, b)=(1,1)$.