## Task 4.

Find all natural numbers $m$ and $n$ such that there exist natural numbers $x$ and $y$ for which

$$
x^{2}+y^{2}+3 x y=11 \cdot 5^{m} \cdot 3^{n}
$$

For such natural numbers $m$ and $n$, determine all $x$ and $y$ that satisfy the above equation in terms of $m$ and $n$.
## Solution.

Since $n$ is a natural number, the right side of the equation is divisible by 3, and since the expression $3xy$ is also divisible by 3, we conclude that the expression $x^{2}+y^{2}$ must be divisible by 3.

The squares of natural numbers, when divided by 3, give remainders of 0 or 1. Remainder 0 is given by the squares of numbers divisible by 3, and remainder 1 is given by the squares of numbers not divisible by 3 (i.e., which give a remainder of 1 or 2 when divided by 3).

Therefore, the expression $x^{2}+y^{2}$ can be divisible by 3 only if both $x$ and $y$ are divisible by 3. However, then the left side of the equation is divisible by 9, so $n$ must be at least 2.

If we write $x=3x'$ and $y=3y'$, and substitute and divide the equation by 9, we get

$$
x'^{2}+y'^{2}+3x'y'=11 \cdot 5^{m} \cdot 3^{n-2}
$$

We can repeat this reasoning as long as the right side of the equation is divisible by 3. Also, from the previous arguments, it follows that the right side cannot be divisible by 3 and not be divisible by 9. Thus, in each step, we divide by 9 as long as the right side is divisible by 3. This shows that $n$ must be an even number.

Let $n=2k$ for a natural number $k$. Then $x=3^{k} \cdot a$ and $y=3^{k} \cdot b$ for natural numbers $a$ and $b$. It must hold that

$$
a^{2}+b^{2}+3ab=11 \cdot 5^{m}
$$

Notice that $a^{2}+b^{2}+3ab=(a-b)^{2}+5ab$, so the equation actually reads

$$
(a-b)^{2}+5ab=11 \cdot 5^{m}
$$

We conclude that $(a-b)^{2}$ must be divisible by 5. Since 5 is a prime number, it follows that 5 divides $a-b$, so $(a-b)^{2}$ is actually divisible by 25.

If $m \geqslant 2$, then the right side of the equation is also divisible by 25, so we conclude that $5ab$ must be divisible by 25, i.e., 5 divides $ab$. Thus, 5 divides at least one of the numbers $a$ and $b$, but we know that they give the same remainder when divided by 5, so we conclude that 5 divides both $a$ and $b$.

Now we can reason similarly to the divisibility by 5 and divide the equation by 25 as long as the right side either has no factor 5 or has only one factor 5. The first case occurs if $m$ is an even number, and the second if $n$ is odd.

This reduces the problem to two cases. If $m$ is an even number, we write $m=2\ell, a=5^{\ell} \cdot c$ and $b=5^{\ell} \cdot d$, and solve the equation

$$
c^{2}+d^{2}+3cd=11
$$

The numbers $c$ and $d$ are natural, so they cannot be greater than 2 (since the expression on the left side would be greater than 11), and by listing all possibilities, we see that the only possibilities are $c=1, d=2$ or $c=2, d=1$.

Thus, for even $m=2\ell$ and even $n=2k$, the solutions are

$$
(x, y)=\left(3^{k} \cdot 5^{\ell}, 2 \cdot 3^{k} \cdot 5^{\ell}\right), \quad(x, y)=\left(2 \cdot 3^{k} \cdot 5^{\ell}, 3^{k} \cdot 5^{\ell}\right)
$$

If $m$ is an odd number, we write $m=2\ell-1, a=5^{\ell-1} \cdot c$ and $b=5^{\ell-1} \cdot d$, and solve the equation

$$
c^{2}+d^{2}+3cd=55
$$

In this case, the numbers $c$ and $d$ cannot be greater than 6 because for $c>6$ we have $c^{2}+3cd > 36+d^{2}+18d \geq 36+1+18=55$. Now we list all possibilities $c, d \in\{1,2, \ldots, 6\}$, and check when $c^{2}+d^{2}+3cd=55$. This is possible only if $c=1$ and $d=6$ or $c=6$ and $d=1$. Thus, for odd $m=2\ell-1$ and even $n=2k$, the solutions are

$$
(x, y)=\left(3^{k} \cdot 5^{\ell-1}, 6 \cdot 3^{k} \cdot 5^{\ell-1}\right), \quad(x, y)=\left(6 \cdot 3^{k} \cdot 5^{\ell-1}, 3^{k} \cdot 5^{\ell-1}\right)
$$