Find all non-zero natural numbers $k, \ell$ such that $2^{k}+3^{\ell}$ is a perfect square.
A first idea is to consider the equation from the statement modulo $n$, where $n$ is not too large such that $\mathbb{Z} / \mathrm{n} \mathbb{Z}$ does not contain too many quadratic residues. Under these conditions, $n=3$ and $n=8$ seem to be good candidates, as the squares modulo 3 are 0 and 1, while the squares modulo 8 are 0, 1, and 4.
Since $k \geqslant 1$ and $\ell \geqslant 1$, we have $2^{k} \equiv 1(\bmod 3)$ and $3^{\ell} \equiv 1(\bmod 8)$, which means that $k$ and $\ell$ are even. By setting $\mathrm{a}=\mathrm{k} / 2, \mathrm{~b}=\ell / 2$ and $\mathrm{c}=\sqrt{2^{k}+3^{\ell}}$, we notice that $\left(\mathrm{c}-2^{\mathrm{a}}\right)\left(\mathrm{c}+2^{\mathrm{a}}\right)=$ $c^{2}-2^{k}=3^{\ell}$ is a power of 3.
![](https://cdn.mathpix.com/cropped/2024_12_06_4f8dc80581b21309a1d2g-2.jpg?height=55&width=1741&top_left_y=1927&top_left_x=189) must necessarily be $3^{\ell}$, while the other is 1. The factor $c+2^{a}$ is the larger of the two, which shows that $c-2^{a}=1$ and $\mathrm{c}+2^{a}=3^{\ell}$, hence $2^{a+1}=3^{\ell}-1=9^{b}-1=\left(3^{b}-1\right)\left(3^{b}+1\right)$. Similarly, since $3^{\mathrm{b}}-1$ and $3^{\mathrm{b}}+1$ are even and $\operatorname{PGCD}\left(2,3^{\mathrm{b}}-1,3^{\mathrm{b}}+1\right)$ divides 2, one of the factors $3^{b}-1$ and $3^{b}+1$ must necessarily be $2^{a}$, while the other is 2. Therefore, $3^{\mathrm{b}}-1=2$ and $3^{\mathrm{b}}+1=2^{\mathrm{a}}$, which shows that $\mathrm{a}=2$ and $\mathrm{b}=1$, or $\mathrm{k}=4$ and $\ell=2$.
Conversely, if $(k, \ell)=(4,2)$, we have $2^{k}+3^{\ell}=2^{4}+3^{2}=16+9=25=5^{2}$. This shows that the pair $(k, \ell)=(4,2)$ is the only solution to the problem.