Editorial
Need a hint? Checkout the editorial.
View Editorial
Editorial
According to the given information there is a two digit number $n=\overline{ab}$ and two positive integers $x>y$ s.t.
$(1) \;\; x + y = 2n$,
$(2) \;\; \sqrt{xy} = \overline{ba}$.
The fact that $\sqrt{xy}$ is an integer implies there is a positive squarefree integer $d$ and two integers $u>v$ s.t.
$(3) \;\; (x,y) = (du^2,dv^2)$.
Combining (3) with (1) and (3) with (2), we obtain
$(4) \;\; d(u^2 + v^2) = 20a + 2b$
and
$(5) \;\; duv = 10b + a$
respectively. Consequently by (4) and (5)
$d(u^2 + v^2) \pm 2duv = (20a + 2b) \pm (20b + 2a)$,
i.e.
$(6) \;\; d(u - v)^2 = 18(a - b)$,
$(7) \;\; d(u + v)^2 = 22(a + b)$.
If $11 \mid d$, then $11 \mid a - b$ by (6), which is impossible since $0 < a-b < 10$. This contradiction implies $11 \nmid d$, which according to (7) means $11 \mid u + v$. Hence $11 \mid a + b$ by (6), yielding $a + b = 11$ (since $1 \leq a + b \leq 18$), which according to (7) give us
$d(u + v) = 2 \cdot 11^2$.
Therefore (since $11 \mid u+v$) we obtain $d=2$ and $u+v=11$. Consequently by (6)
$u - v = 3\sqrt{a - b}$,
yielding (since $a + b = 11$)
$(8) \;\; u - v = 3\sqrt{11 - 2b}$.
Clearly $11 - 2b$ is an odd perfect square, i.e. $11 - 2b \in \{1,9\}$, which means $b \in \{1,5\}$. If $b=1$, then $a = 11 - 1 = 10$, contradicting $a \leq 9$. Hence $b=5$ and $a = 11 - b = 11 - 5 = 6$, which give us $u - v = 3$ by (8). This combined with $u + v = 11$ yields $(u,v) =(7,4)$.
Find the values using it!