<s>[INST] Find all pairs of positive integers $(m,n)$ such that $2^{m+1}+3^{n+1}$ is a perfect square Find all pairs of positive integers $(m,n)$ such that $2^{m+1}+3^{n+1}$ is a perfect square

My attempt so far
Any perfect square is $0,1$ in mod 4, so $n+1$ must be even :
$$2^{m+1}+3^{2r}=k^2$$
Rearranging and factoring
$$2^{m+1}=(k+3^r)(k-3^r)$$
That gives two equations
$$2^a=k+3^r\\2^b=k-3^r\\a+b=m+1;a>b$$
However I am not able to conclude, subtracting/adding...  these equations is not giving me anything useful. Any help is appreciated... Thanks!
 [/INST] All perfect squares are either $0$ or $1 \pmod 3$ so $m+1$ is also even. We now have:
$$2^{2s} + 3^{2r} = k^2$$
Or, equivalently:
$$(2^s)^2 + (3^r)^2 = k^2$$
Wich is a pythagorean triple.
Since $(2^s,3^r) = 1$ then there are integers $p,q$ so that:
$$\begin{cases}2pq = 2^s & \\
p^2 - q^2 = 3^r & \\
p^2 + q^2 = k &
\end{cases}$$
The first equation means that $pq = 2^{s-1}$ thus $p = 2^a$ and $q = 2^b$ for some integers $a,b$ such that $a + b = s-1$
But then because of the second equation then if both $a$ and $b$ are nonzero $4 \mid p^2 - q^2 = 3^r$ wich is false.
If both $a$ and $b$ are zero then $3^r = 0$ wich is also impossible.
Therefore $a > 0$ and $b = 0$
We must now fint the values of $a$ for wich $2^{2a} - 1 = 3^r$
Or equivalently, $4^a - 1 = 3^r$. Checking modulo $4$ we deduce that $r$ is odd.
For $r = 1$ we have $a = 1$.
For $r > 2$ by checking modulo $9$ we deduce that $3\mid a$, thus $4^{3a'} - 1 = 3^{2r'+1}$ 
So $4^{3a'} = 3^{2r'+1} + 1$ with $3\nmid 2r'+1$
Or equivalently, $64^{a'} = 3\cdot 9^{r'} + 1$.
By checking modulo $64$ then $LHS = 0$ but $RHS\in \{4,28,52,12,36,60,20,44\}$.
Therefore, the only solution is indeed $(m,n,k) = (1,1,5)$.
</s>