Select Page

# Understand the problem

Determine all pairs $(m,n)$ of positive integers for which $2^{m} + 3^{n}$ is a perfect square.

Number Theory
Easy
##### Suggested Book
An Excursion in Mathematics

Do you really need a hint? Try it first!

First consider $n=0$. In this case the equation can be rewritten as $2^m=(x+1)(x-1)$. Hence, solving this case is equivalent to looking for powers of 2 that differ by 2.
For $n\ge 1$, consider residues modulo 3. Note that a perfect square cannot have remainder 2 upon division by 3.
Note that $2^m+3^n\equiv (-1)^m\;(\text{mod}\;3)$. From hint 3, it follows that $m$ has to be even. Writing $m=2p$ we get $3^n=(x+2^p)(x-2^p)$.
From hint 3, we may write $x+2^p=3^i$ and $x-2^p=3^j$ for some $i$ and $j$. This gives $3^i-3^j=2^{p+1}$. As the RHS is not divisible by 3, $j$ has to be 0. Thus, $2^{p+1}=3^i-1$. If $p=0$ then $n=1$. Otherwise, the LHS is 0 modulo 4, i.e. $1\equiv 3^i\equiv (-1)^i\;(\text{mod}\;4)$. Hence $i=2k$ for some $k$. Now we again write $2^{p+1}=(3^k+1)(3^k-1)$. Again, we have two powers of 2 differing by 2. It is easy to see that (in case you have not noticed already) only such powers are 2 and 4. Hence $3^k-1=2$.