OFFSET
0,3
COMMENTS
It is believed that a(196) = -1.
REFERENCES
M. Donner, I Love Me, Vol. I: S. Wordrow's palindromic encyclopedia (Algonquin Books, 1996) p. 268
LINKS
T. D. Noe, Table of n, a(n) for n = 0..195
O. Forster, ARIBAS
Mathforum, Making Numbers into Palindromic Numbers
Eric Weisstein's World of Mathematics, 196-Algorithm.
EXAMPLE
19 -> 19 + 91 = 110 -> 110 + 011 = 121, so a(19) = 121.
MATHEMATICA
Table[NestWhile[# + FromDigits[Reverse[IntegerDigits[#]]] &, n, IntegerDigits[#] != Reverse[IntegerDigits[#]] &], {n, 0, 90}] (* Harvey P. Dale, Dec 18 2011 *)
PROG
(ARIBAS): var st: stack; end; for k := 0 to 60 do n := k; while n <> int_reverse(n) do n := n + int_reverse(n); end; stack_push(st, n); end; stack2array(st).
(PARI) a(n)=my(k); while((k=fromdigits(Vecrev(digits(n)))) != n, n += k); n \\ infinite loop if a(n) = -1; Charles R Greathouse IV, Dec 13 2015
CROSSREFS
KEYWORD
nonn,base,nice
AUTHOR
EXTENSIONS
More terms from Jenise Smalley (neicey01(AT)hotmail.com), Oct 18 2001
STATUS
approved