6. Solve the equation $2^{x}+3^{y}=z^{2}$ in natural numbers.
Answer: $(4,2,5)$.

Solution. Since the left side of the equality is odd and not divisible by 3, the number $z$ is also odd and not divisible by 3. Then $z=6u \pm 1$ and $z^{2}=36u^{2} \pm 12u + 1$, which means $z^{2}$ gives a remainder of 1 when divided by 3 and a remainder of 1 when divided by 4. Note that the remainders of powers of two when divided by 3 alternate: for odd powers, it is 2, and for even powers, it is 1. Therefore, the number $x$ is even and, in particular, not less than two. Then $2^{x}$ is divisible by 4. Note that the remainders of powers of three when divided by 4 also alternate: for odd powers, it is 3, and for even powers, it is 1. Since $z^{2}$ gives a remainder of 1 when divided by 4, the number $y$ is even. Let $x=2k$ and $y=2n$. Then

$$
3^{2n}=z^{2}-2^{2k}=\left(z-2^{k}\right)\left(z+2^{k}\right)
$$

The product of the numbers $z-2^{k}$ and $z+2^{k}$ is a power of three, so each of them is also a power of three. Thus, $z-2^{k}=3^{a}$ and $z+2^{k}=3^{b}$ for some non-negative integers $a<b$. Then $3^{b}-3^{a}=2 \cdot 2^{k}=2^{k+1}$. The right side of the equation is not divisible by three, so $a=0$ and, therefore, $b=2n$. Thus, $3^{2n}-1=2^{k+1}$. Therefore,

$$
2^{k+1}=\left(3^{n}-1\right)\left(3^{n}+1\right)
$$

Since the product of the numbers $3^{n}-1$ and $3^{n}+1$ is a power of two, each of them is also a power of two. Thus, $3^{n}-1=2^{c}$ and $3^{n}+1=2^{d}$ for some non-negative integers $c<d$. Then the powers of two $2^{c}$ and $2^{d}$ differ by 2. Therefore, they are $2^{1}$ and $2^{2}$, i.e., $c=1$ and $d=2$. Thus, $x=2k=2(c+d-1)=4$ and $y=2n=2$. Substituting the found $x$ and $y$ into the left side, we get that $z=5$.

## SECOND VARIANT