6. For which prime numbers $p$ and $q$ does the equation $p^{2 x}+q^{2 y}=z^{2}$ have a solution in natural numbers $x, y$ and $z ?$
Answer: $p=2, q=3$ or $p=3$ and $q=2$.

Solution. Due to symmetry, we can assume that $p \leqslant q$. For $p=2$ and $q=3$, the equation has a solution in natural numbers: $2^{4}+3^{2}=5^{2}$.

First, consider the case $p=q$. Let for definiteness $x \leqslant y$. Then $p^{2 x}\left(p^{2(y-x)}+1\right)=z^{2}$. Therefore, $z^{2}$ is divisible by $p^{2 x}$ and $z=p^{x} w$. Simplify both sides by $p^{2 x}$ and obtain the equality

$$
p^{2(y-x)}=w^{2}-1=(w-1)(w+1)
$$

The product of the numbers $w-1$ and $w+1$ is a power of $p$, so each of them is also a power of $p$. Thus, $w-1=p^{\alpha}$ and $w+1=p^{\beta}$ for some non-negative integers $\alpha$ and $\beta$. Therefore, $p^{\beta}-p^{\alpha}=2$, which implies $p^{\alpha}(p^{\beta-\alpha}-1)=2$. Since $p^{\alpha}$ and $p^{\beta-\alpha}-1$ are coprime, we have $p^{\alpha}=1$ and $p^{\beta-\alpha}-1=2$. This gives $p=3$ and $\alpha=0$, $\beta=1$. Therefore, $w-1=1$ and $w+1=3$, which implies $w=2$. Hence, $p^{2(y-x)}=3$, which is impossible since $p=3$ and $2(y-x)$ is even.

Now consider the case $p<q$. Note that $q$ is odd. By the condition,

$$
q^{2 y}=z^{2}-p^{2 x}=\left(z-p^{x}\right)\left(z+p^{x}\right)
$$

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

$$
2 \cdot p^{x}=\left(q^{y}-1\right)\left(q^{y}+1\right)
$$

Note that the numbers $q^{y}-1$ and $q^{y}+1$ are of the same parity and their product is even. Therefore, it is divisible by 4. But then $2 \cdot p^{x}$ is also divisible by 4. Hence, $p=2$. Consequently, the product of the numbers $q^{y}-1$ and $q^{y}+1$ is a power of two. Then each of them is also a power of two. Thus, $q^{y}-1=2^{c}$ and $q^{y}+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., $q^{y}=3$. Thus, $q=3$.

## THIRD VARIANT