TOPICS
Search

Reversal


The reversal of a positive integer n with decimal digits abc...z is the integer represented by z...cba, with any leading zeros omitted. The reversal of n is implemented in the Wolfram Language as IntegerReverse[n].

A positive integer that is the same as its own reversal is known as a palindromic number.

More generally, if n=sum_(j=0)^(k-1)a_jb^j is a positive integer having k base-b digits, where b>=2 is an integer, 0<=a_j<b, and a_(k-1)!=0, its reversal is R_b(n)=sum_(j=0)^(k-1)a_jb^(k-1-j). Since b=1 (mod b-1), it follows that R_b(n)=n (mod b-1), so R_b(n)-n is a multiple of b-1. In particular, for the two-digit decimal integer n=10a+c, R_(10)(n)-n=9(c-a). Similarly, b=-1 (mod b+1) gives R_b(n)=(-1)^(k-1)n (mod b+1).

If two ages are reversals of each other and both have two digits in base b, write the younger age as ba+c and the older as bc+a, where 1<=a<c<=b-1. Their difference is (b-1)(c-a). For a fixed positive difference (b-1)k with 1<=k<=b-2, the possible younger ages are (b+1)a+k for a=1, 2, ..., b-1-k. Successive pairs are therefore b+1 years apart while the two-digit condition holds. For example, in base 10, the pairs 25 and 52, and 36 and 63, occur 11 years apart (Numberphile 2026).

Ball and Coxeter (1987) consider numbers whose reversals are integral multiples of themselves. Palindromic numbers are trivial examples.

The first few numbers that are multiples of their reversals, excluding palindromic numbers and multiples of 10, are 8712, 9801, 87912, 98901, 879912, 989901, 8799912, 9899901, 87128712, 87999912, 98019801, 98999901, ... (OEIS A031877). The pattern continues for large numbers, with numbers of the form 879...9_()12 equal to 4 times their reversals and numbers of the form 989...9_()01 equal to 9 times their reversals. In addition, copies of the same number of either of these forms can be concatenated to yield numbers of the form 879...9_()12...879...9_()12, equal to 4 times their reversals, and 989...9_()01...989...9_()01, equal to 9 times their reversals.

The reversals of these numbers, arranged in increasing order, are 1089, 2178, 10989, 21978, 109989, 219978, ... (OEIS A008919).

The product of a two-digit number and its reversal is never a square number except when the digits are the same (Ogilvy and Anderson 1988).

Numbers whose product is the reversal of the products of their reversals include (221, 312) and (122, 213), since

312×221=68952
(1)
213×122=25986
(2)

(Ball and Coxeter 1987, p. 14).

Non-palindromic numbers n such that n is not divisible by 10 and nR(n) is square, where R(n) is the reversal of n, are given by 144, 169, 288, 441, 528, ... (OEIS A062917).

Examples of perfect powers with exponent greater than 2 resulting from reversal multiplication include

2178×8712=66^4
(3)
2576816×6186752=25168^3.
(4)

In the prime-reversal recurrence, replace each term a_j by the decimal reversal of the a_jth prime number, with p_1=2. Starting at a_0=1 gives 1, 2, 3, 5, 11, 13, 14, 34, 931, ... (OEIS A100475). Veljjanoski (2026) proved that no orbit with a starting value greater than 1 is eventually periodic, answering Vos Post's (2004) question. The start at 1 also cannot lead to a cycle because its next term is 2. The proof uses the fact that the number of decimal digits never decreases: the a_jth prime exceeds a_j, and its final digit is nonzero. Bounds on the prime counting function exclude cycles of constant digit length at least 5, and a finite check excludes the remaining cases. The Palomar Registry records successful Lean proof checking.


See also

Casting Out Nines, Digit Sum, Divisibility Tests, Emirp, Keith Number, Perfect Power, RATS Sequence, Rule of Nines

Explore with Wolfram|Alpha

References

Ball, W. W. R. and Coxeter, H. S. M. Mathematical Recreations and Essays, 13th ed. New York: Dover, pp. 14-15, 1987.Edalj, J. Problem 1622. L'Interméd. Math. 16, 34, 1909.Jonesco, J. Problem 1622. L'Interméd. Math. 15, 128, 1908.Numberphile. "Palindrome Ages." Featuring K. Phillips. Jun. 15, 2026. https://www.youtube.com/watch?v=fwLsCgibGw4.Ogilvy, C. S. and Anderson, J. T. Excursions in Number Theory. New York: Dover, pp. 88-89, 1988.Veljjanoski, D. "OEIS A100475: The Reverse-Prime Map Never Loops." Palomar Registry, 11 Nov 2026. https://palomar-registry.org/entry.html?id=PALOMAR-2026-11-11-000001&version=1.Vos Post, J. Comment on OEIS A100475, 22 Nov 2004. https://oeis.org/A100475.Sloane, N. J. A. Sequences A008919, A031877, A062917, and A100475 in "The On-Line Encyclopedia of Integer Sequences."Welsch. Problem 1622. L'Interméd. Math. 15, 278, 1908.

Referenced on Wolfram|Alpha

Reversal

Cite this as:

Weisstein, Eric W. "Reversal." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/Reversal.html

Subject classifications