Prove that $2^n+3^n $ is never a perfect square

Work $\pmod 3$. We see that $$2^n+3^n\equiv 2^n\pmod 3$$ from which we quickly deduce that your expression is only a square $\pmod 3$ if $n$ is even.

Now work $\pmod 5$. We see that $$2^n+3^n\equiv 2^n+(-2)^n\equiv 2^n(1+(-1)^n)\pmod 5$$ from which we deduce that your expression is only a square $\pmod 5$ if $n$ is odd.


Your method is slightly wrong, as you have to deal with the $x=0$ case. However, the remaining diophantine equation is simple.

Here, I provide you with an alternative approach, though admittedly yours seems better.

For the case $m \equiv 0 \pmod 2$, note that $$2^{2m}+3^{2m}=n^2$$ implies that $2^m=2ab$, and $3^m=a^2-b^2$ where $\gcd(a,b)=1, a \not \equiv b \pmod 2$. This implies that $a=2^{m-1}, b=1$. So all that remains is finding $m,y$ such that $3^{m}=2^{2m-2}-1$.


This is more convoluted than your way, but I already wrote it so I'll just leave it here :-)

$4^m = (a-3^m)(a+3^m) \implies a-3^m = 2^p, a+3^m = 2^q$ with $p+q = 2m$. Note that $q \ge p$

Then $a = 2^p + 3^m = 2^q - 3^m \iff 2^p (2^{q-p}-1) = 2\cdot 3^m$

But then it must be $p=1$, $q = 2m-1$, and we have

$$2^{2(m-1)}-1 = (2^{m-1}-1)(2^{m-1}+1) = 3^m$$

Since only one of the factors in the LHS can be divisible by $3$, it means the other one must be $1$, hence we get $2^{m-1}-1 = 1 \implies m = 2$

But in this case $2^{m-1}+1 = 3 \neq 3^2 $, so this is impossible.