4. Find all integers $a \geqslant 2$ and $b \geqslant 2$ such that $a$ is even and all the digits in the decimal representation of $a^{b}+1$ are equal.

## Solutions
Solution 1 The problem can be rewritten as follows: it is a matter of finding integers $a$ and $b$ such that $9 \times a^{b}+(d+9)=d \times 10^{n}$, with $n \geqslant 1$ and $d \in\{1,3,5,7,9\}$. We therefore handle several cases, depending on the value of $d$:

- If $d \equiv 1(\bmod 4)$, the equality in the statement becomes $9 \times a^{b}=d \times 10^{n}-(d+9)$. If $n \geqslant 2$, this means that $a^{b} \equiv 2(\bmod 4)$, which is incompatible with the fact that $b \geqslant 2$. Therefore, $n=1$ and $a^{b}=d-1$ is equal to $0,4=2^{2}$ or $8=2^{3}$. Thus, in this case, $(a, b)=(2,2)$ or $(a, b)=(2,3)$.
- If $d=3$, the equality in the statement becomes $3 \times a^{b}=10^{n}-4$. If $n \geqslant 3$, this means that $3 \times a^{b} \equiv 4$ $(\bmod 8)$, so that $b=2$. But then $3 \times a^{2} \equiv 1(\bmod 5)$, which is impossible since $3 \times a^{2} \equiv 0,3,2,2,3(\bmod 5)$ depending on whether $a \equiv 0,1,2,3,4(\bmod 5)$. Therefore, $n \leqslant 2$, and $a^{b}$ is equal to 2 or $32=2^{5}$. Thus, in this case, $(a, b)=(2,5)$.
- If $d=7$, the equality in the statement becomes $9 \times a^{b}=7 \times 10^{n}-16$. If $n \geqslant 5$, this means that $9 \times a^{b} \equiv 16(\bmod 32)$, so that $b=2$ or $b=4$. In all cases, $b$ is even, and by setting $c=a^{b / 2}$, we observe that $2 \times c^{2} \equiv 5(\bmod 7)$, which is impossible since $2 \times c^{2} \equiv 0,2,1,4,4,1,2(\bmod 7)$ depending on whether $c \equiv 0,1,2,3,4,5,6(\bmod 7)$. Therefore, $n \leqslant 4$, and $a^{b}$ is equal to $6=2 \times 3,76=2^{2} \times 19,776=2^{3} \times 97$ or $7776=2^{5} \times 3^{5}$. Thus, in this case, $(a, b)=(6,5)$.

In conclusion, the integers sought are the pairs $(a, b) \in\{(2,2),(2,3),(2,5),(6,5)\}$.