Generalizing $\,r(n^2) = r(n)^2,\,$ for $\,r(n) := $ reverse the digits of $n$

decimal-expansionelementary-number-theorypolynomialssquare-numbers

I'm assuming this theorem was found by someone else before, but I found this relationship between square numbers of 3 digits or less. The theorem is this: If you reverse the digits in a square number, then the result will also be a square number. Take the square 961. It is 31 squared, and if you reverse the digits you will get 169, which is also a square number. Plus, 31 and 13(the roots of these reversed squares) are also reverses of eachother. The problem is this breaks with 4 or more digits. If I take the square 1024 and reverse the digits, I get 4201, which is not a square. How can I expand this theorem to fit 4 or more digits?

Best Answer

Congratulations, you have essentially discovered an interesting property of polynomials - as (partially) manifested in their evaluations (here radix $10$ polynomials). Namely, reversing the coefficients of a polynomial is a multiplicative operation.

Let $\,f = a_n x^n +\cdots a_1 x + a_0\,$ be a polynomial in $x.\,$ Reversing its coefficients yields

$\ \ r(f) = a_0 x^n + \cdots a_{n-1}x + a_n = x^n f(x^{-1}),\ $ the reverse (or reciprocal) of $\,f.$

It is easy to show $\,r(fg)\, =\, r(f)r(g),\,$ i.e. polynomial reversal is multiplicative. For example

$\qquad \begin{align} (x+2)\ (x+3)\, &=\ \ x^2+5x+6\, \overset{\large x\, =\, 10}\Longrightarrow\, 12\cdot 13\, =\, 156\\ \overset{\rm reverse}\Longrightarrow (2x+1)(3x+1)\, &= 6x^2+5x+1\ \ \Longrightarrow\,\ \ 21\cdot 31\, =\, 651 \end{align}$

Your examples are special cases when the product is a square (of polynomials of degree $\le 3),\,$ but from above we see it generalizes to arbitrary degree polynomials. However, for the polynomials to yield integer reversals when evaluated at the radix $\,x=10\,$ it is necessary that all polynomials (including the product) have nonnegative coefficients less than the radix (so no carries occur; in the OP squaring case such integers are sometimes called skinny).

Note that reversing twice yields the original polynomial when the reverse has the same degree $(\!\!\iff\! f(0)\neq 0),\,$ i.e. in this case reversing is an involution or reflection $\,r^2 f = f\,$ since we have $r(r(f(x)) = x^n r(f(x^{-1})) = x^n ((x^{-1})^nf((x^{-1})^{-1}) = f(x).\,$ In particular $\,f(0)\neq 0\,$ is true when $\,f = rg\,$ is a reversal, so $\,r^2(rg) = rg,\,$ i.e. $\,r^3g = rg\,$ for all $\,g$.

Remark $ $ Generally the evaluation map helps relate (ring-theoretic) properties of polynomials to properties of their evaluations. For example, in some contexts we can deduce that if a polynomial takes a value with few factors then the polynomial must have few factors too (this is often used in contest problems since it is not as well-known as it should be).

One can push this idea to the hilt to obtain a simple algorithm for polynomial factorization using factorization of its integer values and Lagrange interpolation (using ideas going back to Bernoulli, Schubert and Kronecker).