A030547 Number of terms (including the initial term) needed to reach a palindrome when the Reverse Then Add! map (x -> x + (x-with-digits-reversed)) is repeatedly applied to n, or -1 if a palindrome is never reached.
1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 1, 2, 2, 2, 3, 2, 3, 2, 2, 2, 2, 1, 2, 3, 2, 3, 3, 2, 2, 2, 2, 2, 1, 2, 3, 3, 4, 2, 2, 2, 2, 3, 2, 1, 3, 4, 5, 2, 2, 2, 3, 2, 3, 3, 1, 5, 7, 2, 2, 3, 2, 3, 3, 4, 5, 1, 25, 2, 3, 2, 3, 3, 4, 5, 7, 25
Offset: 1
References
- Daniel Lignon, Dictionnaire de (presque) tous les nombres entiers, Ellipses, Paris, 2012, 702 pages. See Entry 196.
Links
- Eric Weisstein's World of Mathematics, 196 Algorithm.
Programs
-
Mathematica
Table[Length@ NestWhileList[# + IntegerReverse[#] &, n, ! PalindromeQ[#] &], {n, 98}] (* Robert Price, Oct 18 2019 *)
Extensions
Edited by N. J. A. Sloane, May 09 2015
Comments