# reversing digits and squaring

If we reverse the digits of $12$ we will get $21$. $12^{2}=144$. If we reverse its digits we will get $441$ which is $21^{2}$.

Here is the puzzle. How many such two digit numbers are there? Digits must be different.

We got an algebraic method to solve it if the square is a three digit number.It given here :

Let $a>b$ $(10a+b)^{2}=100x+10y+z$ and $(10b+a)^{2}=100z+10y+x$

Difference between these two equations will lead to $a^{2}-b^{2}=x-z$

$x-z \leq 8$.Then $a^{2}-b^{2} \leq 8$.

Since squares are of three digits $a <4$.But since $a>b ,a \neq 1$.

$b=1 \Longrightarrow a^{2} \leq 9$.Then $a=1,2,3$ but only possibilities are $2$ and $3$.

$b=2 \Longrightarrow a^{2} \leq 12 \Longrightarrow a= 1,2,3$. But possibility is $a=3$. So next such pair will be $13,31$. Higher values of $b$ will not work since $a$ cannot exceed 3. This is an explanation we obtained from a mathematics group.It works well if the square is a three digit number.What will happen if square is a 4 digit number... Or if we try to extend this problem for numbers having more than two digits ?

• Without using algebra we can arrive at this result..since square is a three digit number $a,b \leq 3$ moreover they are distinct.And if we assume $a>b$ options are 31,32,21$now one can square and arrive at answer. – Madhu Mar 6 '15 at 2:00 ## 2 Answers 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. the number of such examples is infinite, because we have the following sequence:$12^2=144102^2=104041002^2=100400410002^2=100040004\dots\ \dots\ \dots$and the same with digits reversed:$21^2=441201^2=404012001^2=400400120001^2=400040001\dots\ \dots\ \dots\$

• Two questions I need answer...one.Is there any other two digit numbers with these property whose square is a four digit number...secondly for problem one and for numbers having more than two digits How can we arrive at an answer by using algebra or logic... – Madhu Mar 11 '15 at 17:01