Exercise 6. Find all triplets ( $a, b, c$ ) of strictly positive integers such that

$$
3^{a}-5^{b}=c^{2}
$$
Solution to Exercise 6: Since $3^{a}$ and $5^{b}$ are both odd, $c$ must be even, so $c^{2} \equiv 0[4]$. Since $5^{b} \equiv 1[4]$, we must have $3^{a} \equiv 1[4]$, so $a$ is even. We write $a=2a'$, and the equation becomes

$$
5^{b}=3^{2a'}-c^{2}=\left(3^{a'}-c\right)\left(3^{a'}+c\right)
$$

Note that the sum of the two factors is $2 \times 3^{a'}$, so it is not divisible by 5, meaning one of the two factors is not divisible by 5 and must be 1. It must be the smaller one, so we have

$$
3^{a'}-c=1 \quad \text{and} \quad 3^{a'}+c=5^{b}
$$

or, by adding the last two equations, $2 \times 3^{a'}=5^{b}+1$.

We can now observe that $a'=1$ is a solution, but there do not seem to be any more. A natural way to separate the case $a'=1$ from the rest is to look modulo 9. Indeed, in this case, as soon as $a' \geq 2$, both sides must be divisible by 9, i.e., $5^{b} \equiv -1[9]$. This implies that $b$ must be divisible by 3. Moreover, looking modulo 3, we get that $b$ must be odd. The equation then becomes

$$
2 \times 3^{a'}=5^{3b'}+1=125^{b'}+1
$$

with $b'$ odd. However, the right-hand side then factors by $125+1=126=2 \times 7 \times 9$. In particular, it is divisible by 7, which is not the case for the left-hand side. It is therefore impossible to have $a' \geq 2$. We must therefore have $a'=1$, which leads to the solution $(a, b, c)=(2,1,2)$ in the original equation.

## Senior Exercises