1
$\begingroup$

A three-digit perfect square number is such that if its digits are reversed, then the number obtained is also a perfect square. What is the number?

For example, if 450 were a perfect square then 054 would also have been be a perfect square. Similarly, if 326 were a perfect square then 623 would also have been a perfect square.

I am looking for a non brute force approach.

Bonus: How many such numbers are there such that the number and its reverse are both perfect squares?

What's a general method to find such an n digit number, for a given n?

$\endgroup$
3
  • $\begingroup$ I will post the source a bit later. The source contains the answer although it doesn't explain how the answer was obtained. $\endgroup$ Commented Jun 13, 2024 at 1:10
  • $\begingroup$ Do you mean 054? $\endgroup$ Commented Jun 13, 2024 at 3:18
  • $\begingroup$ @BenjaminWang , yes, made a mistake, corrected. $\endgroup$ Commented Jun 13, 2024 at 4:33

3 Answers 3

4
$\begingroup$

Let $[a_r,\dotsc,a_0]$ denote $\sum_{i=0}^r a_i10^i$ with $0\leq a_i\leq 9$. Let $0\leq n \leq 999$ be a perfect square, say $n=m^2$, where $m=[a,b]$.

Note that $m\leq 31$, so that $0\leq a\leq 3$. Assume for a moment that \begin{equation} \label{eq1} b\leq 3 \qquad\text{and}\qquad 2ab\leq 9.\qquad\qquad\qquad\qquad\qquad (*) \end{equation} Then $n=[a^2,2ab,b^2]$ and its reverse is also a square, namely $n'=[b^2,2ab,a^2]=[b,a]^2$. The pairs $(a,b)$ satisfying (*) with $a\leq b$ lead us to:

  1. $m=[0,0]$ yielding $n=000$
  2. $m=[0,1]$ yielding $n=001=1^2$, $n'=100=10^2$
  3. $m=[0,2]$ yielding $n=004=2^2$, $n'=400=20^2$
  4. $m=[0,3]$ yielding $n=009=3^2$, $n'=900=30^2$
  5. $m=[1,1]$ yielding $n=121=11^2$
  6. $m=[1,2]$ yielding $n=144=12^2$, $n'=441=21^2$
  7. $m=[1,3]$ yielding $n=169=13^2$, $n'=961=31^2$
  8. $m=[2,2]$ yielding $n=484=22^2$

agreeing with the list given by @kagami. When (*) does not hold, then if $b\geq 4$, then $a\leq 2$ and one checks by hand that if $m$ is any of $$ 4,\dotsc,9,14,24,15,25,16,26,17,27,18,28,19,29 $$ then $m^2$ reversed is not a square (I couldn't come up with a shortcut for this last step). Since $m=23$ also doesn't work, the above list is complete.

A general method should be hard to find, but the above approach may be used to produce more examples: if one takes $m=[a,b,c]$ subject to the conditions $$ a^2,2ab,b^2+2ac,2bc,c^2 \leq 9 $$ then $m^2=[a^2,2ab,b^2+2ac,2bc,c^2]$, so that its reverse is also a square, namely $[c,b,a]^2$. For example,

  1. $221^2=48841$ and $122^2=14884$
  2. $201^2=40401$ and $102^2=10404$
  3. $301^2=90601$ and $103^2=10609$

and so on.

One can produce more numbers by taking $m=[a_r,\dotsc,a_0]$ satisfying similar conditions; in general, if you take $a_i\in \{0,1,2\}$ with lots of zeroes in the middle you will get a new example, as in @kagami's last examples. This method will give only answers with an odd numbers of digits, though.

Edit: Answering @kagami's comment, it turns out to be very hard to find examples with an even number of digits. I did a computer search for $m$ up to $10^8$ and, discarding cases ending with zeroes, I have found only:

  1. $1809 = 33^2$, $9801=99^2$
  2. $698896 = 836^2$
  3. $10036224 = 3168^2$, $42263001 = 6501^2$
  4. $637832238736 = 798644^2$
  5. $1021178969603881 = 31955891^2$, $1883069698711201 = 43394351^2$
  6. $4099923883299904 = 64030648^2$

I would expect that there is only a finite number of such examples.

$\endgroup$
7
  • $\begingroup$ Very nice, thorough treatment. Might be worth including a method to solve the final portion of the question for even n. $\endgroup$
    – kagami
    Commented Jun 14, 2024 at 1:47
  • $\begingroup$ @kagami: Thank you! I like your concise solution better :) The problem for an even number of digits seems to be very hard. Your $33^2$ example is rare. I did add some comments on that. $\endgroup$
    – rts
    Commented Jun 14, 2024 at 13:27
  • $\begingroup$ @kagami , can you pls explain this answer in simpler language ? I am not familiar with the Maths terms that rts is using. Also, I am asking you instead of rts because he hasn't been active here for more than a month. $\endgroup$ Commented Aug 5, 2024 at 1:44
  • $\begingroup$ It just comes down to noting that the easiest way to solve the problem is to choose a number that, when squared, doesn't involve carrying any digits. That is, if you did the multiplication in the typical way by hand, the addition step would have no instances of carrying a one to the next place. This is achieved by having low values in each of your digits, namely 1s and 0s, though for smaller digit numbers you can get away with some 2s and sometimes even a single 3. This always yields a number with an odd number of digits, though. $\endgroup$
    – kagami
    Commented Aug 5, 2024 at 17:02
  • $\begingroup$ 33^2 = 1089, not 1809. Perhaps a typo. Please check. $\endgroup$ Commented Aug 8, 2024 at 8:37
4
$\begingroup$

121, 144, 169, 441, and 484, and 961 should be all of them, assuming leading 0s are no good. With the question as written, I interpret leading zeros being ok for the reversed sequence, which lets us include 100, 400, and 900. We can square any two digit number less than 32 and whose reverse is less than 32 to get such a number.

For any odd n, I can just take $(10^{(n-1)/2} + 1)^2$, which will be a palindromic perfect square of the form 1000...2...0001. Even simpler is just $10^{n-1}$. For n = 4, it looks like $33^2$ = 1089 => 9801 = $99^2$ works, so we can just square $33 * 10^{n/2 - 2}$ for any even $n \ge 6$

$\endgroup$
0
$\begingroup$

100 is the square of 10. then reverse it 001, then 1 is also a perfect square.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.