# Solve $2^x+3^y=z^2$ in nonnegative integers.

So, we are trying to find all the solutions to $2^x + 3^y = z^2$ in nonnegative integers. Here are my insights:

First of all, $z^2$ can be either $0$ or $1$ modulo $3$. If $z^2 = 3k$, then LHS cannot be divisible by $3$ unless $y = 0$ and $x=2k+1$, and so we have $2^x+1 = z^2$, so one of the solutions is $(3,0,3)$ (but we still need to show that this is the only solution in this case).

Now let $y > 0$, $x=2k$. In this case $2^x \equiv 1\ (\mod\ 3)$ and $z^2 \equiv 2^x (\mod 3)$. We have $$3^y = (z-2^k)(z+2^k),$$ so $(z-2^k)=3^a$ and $(z+2^k)=3^b$, so $3^b-3^a = 2^{k+1}$. If $a > 0$, then $2^{k+1}$ must be divisible by $3$, but it is not, so suppose $a = 0$. Now we have $$2^{k+1} = 3^b - 1,$$ Аnd this is where I stuck. It is easy to find two more solutions just iterating over $k$, but I do not know how to prove that there are no others. As far as I understand, we need to find some kind of an upper bound for $k$. Note: I am trying to avoid the use of Catalan's conjecture here.

Can you please help me to show that there are no other solutions to this equation and that $2^x+1=z^2$ has a unique solution?

$2^x = z^2 - 1 \Rightarrow 2^x = (z+1)(z-1)$. If $x$ and $z \in \mathbb N$, then this can be true only for $z=3$ as difference between $z+1$ and $z-1$ equals $2$ and we have no other degrees of $2$ which are different by $2$.

$2^x + 1 = z^2$, therefore $z=2m+1$ (m is non-negative integer).
$2^x + 1 = 4m^2 + 4m + 1 \; \Rightarrow \;2^x = 4m(m+1) \; \Rightarrow \; 2^{x-2} = m(m+1)$
$m(m+1)$ is the power of $2$ if and only if m=1 (because $GCD(m,m+1)=1$).
Therefore, 2^x+1 =z^2 has one solution, and it is $x=3$, $z=3$.

But there are other solutions, $x=0$, $y=1$, and $z=2$. Also $x=4$, $y=2$, and $z=5$.

It is well known that the Diophantine equation $2^x+3^y=z^2$ has only the following non-negative integral solutions: $(0, 1, 2), (3, 0, 3), (4, 2, 5)$. For a reference see the article of Sroysang, 2013.

• Unfortunately, in this paper he refers to another one by Chotchaisthit, which I cannot find online. – AlexCon Feb 24 '15 at 12:32
• Try other references in the web, e.g., here. – Dietrich Burde Feb 24 '15 at 12:33
• But all of them use the Catalan's conjecture. Is it possible to avoid that in this particular case? – AlexCon Feb 24 '15 at 12:41
• I think, no, but I did not try so far. Catalan's conjecture is already proved, so why not use it. – Dietrich Burde Feb 24 '15 at 12:49