Recently, I had the pleasure of finding out that
$$13^2=169\quad\text{and}\quad 31^2=961.$$
It had me wondering . . .
The Question:
What pairs of distinct natural numbers $r,s$ have decimal expansions $r=\overline{a_1\dots a_n}$ and $s=\overline{a_n\dots a_1}$ such that $$(\overline{a_1\dots a_n})^2=\overline{x_1\dots x_m}\quad\text{and}\quad (\overline{a_n\dots a_1})^2=\overline{x_m\dots x_1}?$$
Clarification: I'm asking for all of them; that is, is there a formula or something?
Thoughts:
I have no idea.
Single digit numbers won't do.
According to Approach0, this is new to MSE. The closest I could find on the OEIS is this.
Other pairs include $12$ & $21$ and $102$ & $201$.
This is the sort of thing a programme could search for. I have a rough idea of how I might write one, but it would be very inefficient. Here is the gist:
DecimalExpansionAsList:=function(n)
return decimal expansion of n as a list somehow;
end;
ListToNumber:=function(L) # L is a list of natural numbers less that 10
local m; # m length of L
return (10^m)L[m]+(10^(m-1))L[m-1]+ (somehow continue like this)
end;
NumberPairs:=[];
for i in [0..9] do
for j in [0..9] do
for k in [0..9] do
n:=ListToNumber([i,j,k]);
m:=ListToNumber([k,j,i]);
if DecimalExpansionAsList(n^2)=(Swap order of DecimalExpansionAsList(m^2) somehow) then
AddSet(NumberPairs, [n,m]);
fi;
od;
od;
od;
Print(NumberPairs);
I would be surprised if the examples listed above are the only ones.
Further Context:
I came up with this question myself. I don't think I could answer it myself.
Please help :)