4

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 :)

Shaun
  • 44,997
  • 1
    Oops! I think I found them: https://oeis.org/A106324. Sorry! – Shaun Jul 21 '23 at 17:47
  • are they finite? – hellofriends Jul 21 '23 at 18:02
  • 1
    I doubt it, @hellofriends :) – Shaun Jul 21 '23 at 18:03
  • That list above isn't them $1056^2=1115136$ but $6501^2=42263001$. – Shaun Jul 21 '23 at 18:05
  • 1
    No, @hellofriends. – Shaun Jul 21 '23 at 18:06
  • See here: $10^n+2$ works for natural $n$. – Shaun Jul 21 '23 at 18:06
  • Unless there's a mistake on the OEIS . . . – Shaun Jul 21 '23 at 18:11
  • 1
    Something looks weird about that entry. It has $99$ but doesn't have $11$. – jjagmath Jul 21 '23 at 18:16
  • Various mistakes in the OEIS regarding these numbers are throwing me off, @jjagmath. – Shaun Jul 21 '23 at 18:17
  • See here, @jjagmath. – Shaun Jul 21 '23 at 18:18
  • 1
    In any case, that's not the sequence you're asking about. That sequence seems to consider the max of the pairs $a,b$ such that $a^2$ is the reverse of $b^2$ BUT doesn't ask $a$ to be the reverse of $b$ – jjagmath Jul 21 '23 at 18:43
  • What is the question ? There are tons of solutions (not being palindromes!) – Peter Jul 21 '23 at 20:33
  • I'm asking for exactly all such pairs, @Peter. Maybe there's a nice formula for them or something . . . – Shaun Jul 21 '23 at 21:02
  • I ask for distinct pairs, @Peter, so palindromes don't count! – Shaun Jul 21 '23 at 21:06
  • 1
    I doubt there is a formula for them. For most interesting problems involving the decimal expansion of the numbers there's usually no formulas. – jjagmath Jul 22 '23 at 00:29
  • I don't think you've actually found any errors in OEIS. You have just found sequences whose criteria are different from the sequence you want. The "errors" are numbers that correctly belong to those sequences but not to your sequence. – David K Jul 22 '23 at 02:14
  • 1
    For example, https://oeis.org/A035123 doesn't say anything about reversing the digits of any number in the sequence itself. What it does say is you can reverse the digits of the square of a number in the sequence and the result will be a square. For example, $3140793^2=9864580668849$; reversing the digits of $9864580668849$ gives $9488660854689$, where $9488660854689=3080367^2$. It's true that $3080367$ is not the reverse of $3140793$, but this OEIS sequence never said that it must be. – David K Jul 22 '23 at 02:19
  • 1
    I think what you have is https://oeis.org/A061909 – see also https://oeis.org/wiki/Index_to_OEIS:_Section_Sq#sqrev – Gerry Myerson Jul 22 '23 at 03:41

1 Answers1

0

Approach0 only works if you can guess a formula that must occur in the question. In this case it is possible to say that $961$ is the square of $31$ without actually writing $31^2 = 961$. So it did not find the question Generalizing $\,r(n^2) = r(n)^2,\,$ for $\,r(n) := $ reverse the digits of $n$, which is very close to your question.

This answer to that other question relates your question to a theorem about polynomials. The reciprocal of a polynomial $p(x)$ can be constructed by reversing the coefficients of $p(x)$; that is, if $p(x)$ has degree $n$, we swap the coefficients of $x^n$ and $1$, swap the coefficients of $x^{n-1}$ and $x$, and so forth.

Let's use a superscript asterisk to denote reversing coefficients; that is, the reciprocal of the polynomial $p(x)$ is written $p^*(x)$.

The linked answer points out that if $f(x)$, $g(x)$, and $h(x)$ are polynomials such that $f(x)g(x) = h(x)$, then $f^*(x)g^*(x) = h^*(x)$. In the case where $g$ is the same as $f$, this means that $$ h(x) = (f(x))^2 \implies h^*(x) = (f^*(x))^2, $$

that is, the reversal of the square of a polynomial is the square of the reversal of the same polynomial; therefore, if all the coefficients of $f(x)$ and $h(x)$ are positive single-digit numbers (or, for coefficients other than the first or last, possibly zero), and $f(x)$ is not a palindromic polynomial (that is, $f(x) \neq f^*(x)$), then $f(10)$ and $f^*(10)$ form one of the pairs you are looking for.

The reason why the coefficients of $f(x)$ must be positive single-digit numbers or zero is so that $f(10)$ will be the standard expansion of the value of a base-ten numeric representation:

$$ a_n 10^n + a_{n-1} 10^{n-1} + \cdots + a_2 10^2 + a_1 10^1 + a_0. $$

The reason for the restriction on the coefficients of $h(x)$ is that if the coefficient of $x^k$ in $h(x)$ has two digits or more, then some of the digits of that coefficient will carry into places to the left of the $10^k$'s place when $h(10)$ is written in base ten. For example, let $f(x) = 2x^2 + 3$. Then $f^*(x) = 3x^2 + 2$, \begin{align} (f(x))^2 &= 4x^4 + 12x^2 + 9, \\ (f^*(x))^2 &= 9x^4 + 12x^2 + 4, \end{align} which are reciprocal polynomials, but when we plug in $x=10$ we have\begin{align} (f(10))^2 &= (203)^2 = 41209, \\ (f^*(10))^2 &= (302)^2 = 91204, \end{align} and the squares are not reversals of each other because the $1$ from the coefficient $12$ went into the thousands place in both cases, breaking the symmetry.

The restriction on the coefficients of $h(x)$ means that none of the coefficients of $f(x)$ can be greater than $3$, since $(a_k x^k)^2 = a_k^2 x^{2k}$. If there is a coefficient $3$ in $f(x)$, no other coefficient can be greater than $1$, since $(3 x^k + a_m x^m)^2$ produces the term $6a_m x^{k+m}$. But it seems you can have any number of non-zero coefficients as long as you insert zero coefficients between them in such a way that you never have too many pairs of coefficients in $f(x)$ contributing to the same coefficient in $h(x)$. It seems difficult to come up with a simple formula to generate all possibilities.

David K
  • 98,388