I've recently came across this problem and, although I've spent time looking for a solution, I don't have any interesting ideas.
Let the numbers $$x_1=25$$ $$x_2=2245$$ $$x_3=222445$$ and $x_n=22..244...45$ with $n$ digits $'2'$ and $n-1$ digits $'4'$
Prove that $x_n$ can be written as a sum of two perfect squares for any natural number $n\ge1$.
The first impulse was to decompose the number:
$$ x_n = 2 \times \left(10^{2n-1}+\dots+10^n\right) + 4 \times \left(10^{n-1}+\dots+10\right)+ 5$$ $$ x_n = 2 \times \frac{10^{2n}-10}{9} + 2 \times \frac{10^{n}-10}{9} + 5$$ $$ x_n = \frac{20}{9} \left(10^{2n-1} - 1 + 10^{n-1} - 1\right) + 5$$ Anyway, this doesn't seem to lead to the good track. A piece of advice or a hint would be apreciated.
P.S. I guess that it's because of the Stack Exchange android app, but although I wrote something on the first line ("Hi there"), this doesn't appear in the post. This happened several times.
You are on the right track. Write everything as a fraction with denominator 9 and use the fact that $10^n \equiv 1\pmod 3$ for all $n \geq 1$.