Find all pairs $(x, y)$ of natural numbers such that $x+y=a^{n}, x^{2}+y^{2}=a^{m}$ for some natural numbers $a, n$, and $m$.

#
Given the condition $a^{2 n}=x^{2}+y^{2}+2 x y=a^{m}+2 x y>a^{m}$, it follows that $a^{2 n}$ is divisible by $a^{m}$. Therefore, $2 x y$ is also divisible by $a^{m} = x^{2} + y^{2}$. We obtain that

$2 x y \geq x^{2} + y^{2} \geq 2 x y$. From this, $x^{2} + y^{2} = 2 x y, x = y$. Therefore, $2 x = a^{n}, 2 x^{2} = a^{m}$, from which $4 x^{2} = a^{2 n}, 2 = a^{2 n - m}$. Finally, $a = 2, x = y = 2^{k}$, where

$k \geq 0$.

## Answer

$\left(2^{k}, 2^{k}\right)$, where $k \geq 0$.