Find all natural solutions that satisfy $2^ + 3^ = ^2$ It looks like an easy question but I couldn't find a way to solve it. I found (0,1,2),(3,0,3),(4,2,5) by trial and error and I'm kinda sure they are the only answers but I'm not sure how to prove it.
 A: First consider the cases $x=0$ and $y=0$. If $x=0$, then $3^y=z^2-1=(z-1)(z+1)$ and hence $z-1$ and $z+1$ are two powers of $3$ with distance $2$; that immediately implies $z+1=3, z-1=1$ and so $z=2, y=1$. If $y=0$, then $2^x=z^2-1=(z-1)(z+1)$ and hence $z-1$ and $z+1$ are two powers of $2$ with distance $2$; that immediately implies $z+1=4, z-1=2$ and so $z=3, x=3$. We thus have the solutions $(0,1,2)$ and $(3,0,3)$.
Now let $x,y>0$. Considering the equation mod $3$, we see that the RHS is $\equiv 0,1$ (as it is a square) and the LHS is $\equiv 2^x$. As $2^x\equiv 0\pmod{3}$ is impossible, we must have $2^x\equiv 1\pmod{3}$, which means that $x$ is even. As a consequence, $x=2x'$ for some $x'>0$. Considering the equation mod $4$, we now see that the RHS is $\equiv 0,1$ and the LHS is $\equiv 3^y$. As $3^y\equiv 0\pmod{4}$ is impossible, we must have $3^y\equiv 1\pmod{4}$, which means that $y$ is even. As a consequence, $y=2y'$ for some $y'>0$.
We now have the equation
$$2^{2x'}+3^{2y'}=z^2\Leftrightarrow \left(2^{x'}\right)^2+\left(3^{y'}\right)^2=z^2$$
and so $\left(2^{x'}, 3^{y'}, z\right)$ is a Pythagorean triple; it is even a primitive Pythagorean triple. Such triples are of the form $\left(2uv, u^2-v^2, u^2+v^2\right)$ for coprime integers $u>v$ with distinct parity. We must then have $2uv=2^{x'}$ as both of them are the only even numbers in each triple; this means that $u$ and $v$ are both powers of $2$. However, they must also be coprime and have different parity, so the only option is $u=2, v=1$. This gives $x'=2$ and $u^2-v^2=3$, which is indeed a power of $3$, so $y'=1$. Hence, $x=4$ and $y=2$, which leads to $z=5$. Therefore, we have the additional solution $(4,2,5)$.
In conclusion, the solutions $(0,1,2), (3,0,3), (4,2,5)$ are the only ones.
A: If $y=0$, we have $2^x=z^2-1=(z+1)(z-1)$, for which the only solution is $x=z=3$. That is, we have $z+1=2^a$ and $z-1=2^b$ with $a+b=x$. But then $2=(z+1)-(z-1)=2^a-2^b$, for which the only solution is $a=2$ and $b=1$, from which $x=z=3$ follows.
If $y\ge1$, then $2^x$ is a square mod $3$, which implies $x$ is even. Writing $x=2w$, we have
$$3^y=z^2-2^{2w}=(z+2^w)(z-2^w)$$
which implies $2^{w+1}=3^y-1$. (That is, $z+2^w$ and $z-2^w$ must each be a power of $3$ whose exponents' sum is $y$, so their difference, which is $2\cdot2^w$, is the difference of those two powers of $3$. But $2^{w+1}$ is not divisible by $3$, so the smaller exponent must be $0$.) Now if $y$ is odd, then $3^y\equiv3$ mod $8$, which implies $2^{w+1}\equiv2$ mod $8$, so that $w$ can only be $0$, which gives us the solution $(x,y,z)=(0,1,2)$ and no other solutions with $y$ odd. On the other hand, if $y$ is even, say $y=2v$, then, writing $z'=3^v$, we have $2^{w+1}=z'^2-1$, for which we saw in the first paragraph there is only the solution $w+1=z'=3$, giving us the solution $(x,y,z)=(4,2,5)$ and no other solutions with $y$ even.
So that's it: the equation $2^x+3^y=z^2$ has the three solutions $(3,0,3)$, $(0,1,2)$, and $(4,2,5)$ and no others.
A: First, let us solve the equation $3^a = 2^b-1$, where $a, b \in \mathbb{N}$.
For $b = 0$ we have no solutions.
For $b = 1$ we obtain $a = 0$. For $b = 2$ we get $a=1$. If $b \ge 3$ then $2^b-1 \equiv -1(\text{mod } 8)$ and hence we have no other solutions, since $3^a \equiv 1,3(\text{mod } 8)$.
In conclusion, we get the solutions $(a,b) \in \{(0,1), (1,2) \}$.
Now, consider the equation $2^x + 3^y = z^2$, where $x,y,z \in \mathbb{N}$.
If $x = 0$, then $3^y = (z-1)(z+1)$ and hence $z-1 = 3^u$, $z+1 = 3^v$ for $u , v \in \mathbb{N}, u<v$. It follows that $2 = 3^v - 3^u$. Therefore, $u = 0$ and $v = 1$. In this case, we obtain the solution: $(x,y,z)= (0,1,2)$.
If $x=1$, then $2+3^y = z^2$. For $y = 0$ we have no solutions and if $y \ge1$, we have $z^2 \equiv 2(\text{mod } 3)$, which is impossible.
Assume $x \ge 2$. Then $y$ is even. Indeed, for $y$ odd we have $z^2 = 2^x+3^y \equiv 3(\text{mod } 4)$, which is false. So, $y = 2k$, for some $k \in \mathbb{N}$. It follows that $2^x = (z-3^k)(z+3^k)$. Hence $z-3^k = 2^u$ and $z+3^k = 2^v$, for $u , v \in \mathbb{N}, u<v$. Thus,
$$2\cdot 3^k = 2^v - 2^u \implies 3^k = 2^{v-1} - 2^{u-1}$$
It follows that $u-1 = 0$, i.e. $u=1$ and
$$3^k = 2^{v-1}-1$$
We have seen that the only solutions of this equation are $(k, v) \in \{ (0,2), (1,3) \}$.
Consequently, we obtain the other two solutions: $(x,y,z) = (3,0,3)$ and  $(x,y,z) = (4,2,5)$
