find all positive integer $a\geq 2 $ and $b\geq2$ such that $a$ is even and all the digits of $a^b+1$ are equals.
Problem
Source: P4 francophone math olympiad senior 2022
Tags: number theory
24.05.2022 16:49
First, let $a^{b}+1=\overline{\underbrace{mm \dots m}_{k \text{ digits of } m}}$ where $m$ and $k$ are positive integer numbers and $m \le 9$. Divide this solution into two cases. Case 1, $k=1$. It's easy to check that $(a,b)=(2,2),(2,3)$ are all solutions for this case. Case 2, $k \ge 2$. Observe $\text{mod } 4$. Note that $4 | a^{b}$, so we get $a^{b}+1 \equiv 1 \ (\text{mod } 4) \iff \overline{\underbrace{mm \dots m}_{k \text{ digits of } m}} \equiv 1 \ (\text{mod } 4) \iff \overline{mm} \equiv 1 \ (\text{mod } 4) \iff 11m \equiv 1 \ (\text{mod } 4) \iff m \equiv 3 \ (\text{mod } 4)$, which implies $m=3, 7$. From here, divide this case into two subcases. Subcase 1, $m=3$. First, assume that $k \ge 3$. Observe $\text{mod } 8$. Note that $\overline{\underbrace{33 \dots 3}_{k \text{ digits of } 3}} \equiv 333 \equiv 5 \ (\text{mod } 8) \iff a^{b}+1 \equiv 5 \ (\text{mod } 8) \iff a^{b} \equiv 4 \ (\text{mod } 8)$. From here, if $b \ge 3$, we get $8 | a^{b}$, which is not true, so it must be $b=2$. However, by observing $\text{mod } 3$, we'll get $a^{2}+1 \equiv \overline{\underbrace{33 \dots 3}_{k \text{ digits of } 3}} \equiv 0 \ (\text{mod } 3) \iff a^{2} \equiv -1 \ (\text{mod } 3)$, which is impossible. Contradiction. Thus, it must be $k=2$. Now, it's easy to check that $(a,b)=(2,5)$ is all solution for this subcase. Subcase 2, $m=7$. First, assume that $k \ge 5$. Observe $\text{mod } 32$. Note that $\overline{\underbrace{77 \dots 7}_{k \text{ digits of } 7}} \equiv 77777 \equiv 17 \ (\text{mod } 32) \iff a^{b}+1 \equiv 17 \ (\text{mod } 32) \iff a^{b} \equiv 16 \ (\text{mod } 32)$. From here, if $b \ge 5$, we get $32 | a^{b}$, which is not true, so it must be $b=2,3,4$. However, by observing $\text{mod } 7$, we'll get $a^{2}+1 \equiv \overline{\underbrace{77 \dots 7}_{k \text{ digits of } 7}} \equiv 0 \ (\text{mod } 7) \iff a^{2} \equiv -1 \ (\text{mod } 7)$ and $a^{4}+1 \equiv \overline{\underbrace{77 \dots 7}_{k \text{ digits of } 7}} \equiv 0 \ (\text{mod } 7) \iff a^{4} \equiv -1 \ (\text{mod } 7)$, which are impossible. And also, by observing that $16|a^{3}$ and $32 \nmid a^{3}$, we'll get $a^{3}=2^{4} \cdot n$ where $n$ is an odd number, which is impossible. Contradiction. Thus, it must be $k \le 4$. Now, it's easy to check that $(a,b)=(6,5)$ is all solution for this subcase. Therefore, all solutions for this case are $(a,b)=(2,5),(6,5)$. Finally, it can be concluded that all solutions for this problem are $(a,b)=(2,2),(2,3),(2,5),(6,5)$.