Diophantine equation about 3 variables Find all natural $n,m,k$ solutions to the Diophantine equation :
$$4^n+4^m=k(k+1)$$
My idea: We can assume $m<n$ and write $4^m(1+4^{n-m})=s(s+1)$. Since $(s,s+1)=1$, we see $4^m$ must be only in $s$ or $s+1$. In both case some odd divisors of $1+4^{n-m}$ may belong to $s$ or $s+1$. How can we conclude this idea. Actually if we can show that whenever $s$ is even it is only $s=4^m$ and similarly the other case.
 A: If (without loss of generality) $m=0$ the equation reduces to $1+4^n=k(k+1)$; the right-hand side is always even but the left-hand side can only be even if $n=0$, forcing $k=1$. If $n=m>0$ we have a power of two being equal to the product of an even and odd number, which is impossible. Hence assume $n>m>0$ from now on.
Write $n-m=q>0$. We want to distribute factors of $4^m(1+4^q)$ to $k$ and $k+1$ such that one is even and the other is odd. But if factors of $2$ (and there are at least two of them) appear in both $k$ and $k+1$, both are even, so $4^m$ divides one of $k$ and $k+1$. Now note that for any prime dividing $4^q+1=(2^q)^2+1$, $-1$ is a quadratic residue, so any factor of $4^q+1$ is $1\bmod4$. Hence $k=4^mr$ and $k+1=s$ where $rs=4^q+1$, i.e. $4^q+1=r(4^mr+1)$. Applying the quadratic formula to $r$ gives
$$r=\frac{-1+\sqrt{4^{n+1}+4^{m+1}+1}}{2\cdot4^m}$$
and the only way to make $r$ an integer is to set $n=2m$ so $r=1$: for a given $n$,

*

*$m<n/2$ will not work because the expression under root will then lie strictly between two consecutive squares, so cannot be an integer after taking the root

*$m>n/2$ will not work because then $r<1$
In summary, the natural number solutions to $4^m+4^n=k(k+1)$ are described by $(n,m,k)\in\{(2t,t,4^t):t\ge0\}$.
