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

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!

• Subtracting the equations gets you further, surely – Mark Bennet May 6 '15 at 9:19
• Note that for all positive (m,n), k is odd, that is, k=2p+1. From the last 3 equations you stated, we get 2^a+2^b=2k, so 2^(a-1)+2^(b-1)=k=2p+1 To make LHS odd, and w/ a>b, 2^(b-1)= 1 So b=? – Mythomorphic May 6 '15 at 9:20
• thats nice, b=1 – drae May 6 '15 at 9:30
• math.stackexchange.com/questions/1142313/… – Sawarnik May 6 '15 at 10:38

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

• thanks, i missed mod3, pythagorean triples is a brilliant idea..im still going through the solution.. thank you so much :) – drae May 6 '15 at 9:36