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.


2 Answers 2


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$.

  • $\begingroup$ Zsigmondy's theorem ? Can't we think of something more elementary ? $\endgroup$
    – user217921
    Mar 28, 2015 at 11:00
  • 1
    $\begingroup$ @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. $\endgroup$ Mar 28, 2015 at 11:02
  • $\begingroup$ 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. $\endgroup$ Mar 28, 2015 at 11:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy