reversing digits and squaring

Solution 1:

In response to your question: while there are many solutions where the squares have an odd number of digits, there are none for squares with an even number of digits such as 4.

Proof: Let $n \neq r$ be the number and its reverse, and let $10^{2k+1} < n^2 \neq r^2 < 10^{2k+2}$. Then $r^2$ ends with 1, 2, 5, 6 or 9 (not a 0, since then $n$ would start with 0). However, if $r^2$ ends with 1 then $n^2$ must start with 1, meaning $3.16 \times 10^{k} < n < 4.47 \times 10^{k}$; hence $n$ must start with either 3 or 4; but then $r^2$ ends with 9 or 6, a contradiction. By the same logic, if $r^2$ ends with 2 then $n$ starts with 4 or 5, meaning $r^2$ ends with 6 or 5. If $r^2$ ends with 5, $n$ starts with 7. If $r^2$ ends with 6, $n$ starts with 7 or 8. And if $r^2$ ends with 9, $n$ starts with 9. Since none of these are possible, no solution exists.

@tong_nor's answer demonstrates an infinite sequence of examples where the squares have an odd number of digits. In fact, there are many other such examples. A quick Python script suggests that all the the digits of the roots are always in the range 0 to 3. Proving this may be a good follow uo question.

Solution 2:

the number of such examples is infinite, because we have the following sequence:

$12^2=144$

$102^2=10404$

$1002^2=1004004$

$10002^2=100040004$

$\dots\ \dots\ \dots$

and the same with digits reversed:

$21^2=441$

$201^2=40401$

$2001^2=4004001$

$20001^2=400040001$

$\dots\ \dots\ \dots$