# How to find all positive integers $m,n$ such that $3^m+4^n$ is a perfect square?

How to find all positive integers $m$, $n$ such that $3^m+4^n$ is a perfect square? I have found $m=n=2$ is a solution, but cannot find any other and cannot prove whether there is any other solution or not. Please help. Thanks in advance.

Since $3=-1$ modulo $4$ and $3^2=1$ modulo $4$ the sum $3^m+4^n$ can only be a square when $m$ is even. Therefore we want that $$(3^j)^2+ (2^n)^2$$ is a square. Using the formula for Pythagorean triples we see that necessarily $$3^j=p^2-q^2,\qquad 2^n=2pq\ .$$ It follows that $p=2^r$, $q=2^s$ with $r\geq s\geq0$ and therefore $$3^j=2^{2r}-2^{2s}=2^{2s}(2^{2(r-s)}-1)\ .$$ This implies $s=0$ and $3^j=(2^r+1)(2^r-1)$. Here not both factors on the right hand side can be nontrivial powers of $3$; whence $r=1$ and then $j=1$.
It follows that $3^2+4^2=25$ is the only solution to the problem.
$$3^m+4^n = q^2 \tag{1}$$ can be written as: $$3^m = (q-2^n)(q+2^n) \tag{2}$$ so $(1)$ is fulfilled any time we have that two powers of three differ by a power of two: $$3^A-3^B = 2^C. \tag{3}$$ Obviously that may happen only if $B=0$, because otherwise the LHS of $(3)$ is a multiple of three while the RHS is not. However, by Zsigmondy's theorem the only solutions of: $$3^A-1 = 2^C \tag{4}$$ are given by $A=2,C=3$, leading to $m=n=2,q=5$, and by $A=1,C=1$, leading to $m=1,n=0,q=2$.
• @SaunDev: $(4)$ is a well-known problem, probably there are a dozen of good ways to solve it, Zsigmondy's theorem is just the first tool that came into my mind. Mar 28, 2015 at 11:02
• Another possibility is to study $\nu_3(2^C+1)$ and prove that $A>2$ implies that $C$ must be quite big in order to have $\nu_3(2^C+1)=A$, so big that $3^A\approx 2^C$ cannot hold. Mar 28, 2015 at 11:06