login
A065208
Three 'Reverse and Add' steps are needed to reach a palindrome.
3
59, 68, 86, 95, 155, 156, 157, 158, 164, 165, 168, 178, 180, 184, 185, 186, 194, 199, 249, 254, 255, 256, 257, 263, 264, 267, 277, 283, 284, 285, 293, 298, 299, 348, 349, 354, 355, 356, 362, 366, 376, 382, 384, 389, 392, 397, 398, 399, 439, 447, 448, 449, 452, 453, 455, 461, 462, 465, 475, 481, 482, 483, 488, 489, 491, 496, 497, 498, 499, 538, 546, 547, 548, 551, 552, 553, 554, 560, 561, 564, 574, 580, 581, 582, 587, 588, 590, 596, 597, 598, 637, 645, 647, 650, 651, 652, 653, 660, 663, 673, 680, 681, 687, 694, 695, 697, 736, 744, 745, 746, 750
OFFSET
1,1
COMMENTS
The number of steps starts at 0, so palindromes (cf. A002113) are excluded.
MATHEMATICA
palQ[n_]:=Module[{idn=IntegerDigits[n]}, idn==Reverse[idn]]
tst[n_]:=palQ/@NestList[#+FromDigits[Reverse[IntegerDigits[#]]]&, n, 3]=={False, False, False, True}
Select[Range[750], tst] (* Harvey P. Dale, Nov 26 2010 *)
PROG
(ARIBAS): revadd_steps(3, 54). For the definition of function revadd_steps see A065206.
(PARI) Rev(x)= { local(d, r=0); while (x>0, d=x-10*(x\10); x\=10; r=r*10 + d); return(r) } digitsIn(x)= { local(d); if (x==0, return(1)); d=1 + log(x)\log(10); if (10^d == x, d++, if (10^(d-1) > x, d--)); return(d) } Palin(x)= { local(d, e, f, i, t, y); if (x==0, return(1)); y=x; d=digitsIn(x); t=10^(d - 1); for (i=1, d\2, f=y-10*(y\10); y\=10; e=x\t; x-=t*e; t/=10; if (e!=f, return(0)) ); return(1) } { n=0; for (m = 0, 10^9, p=m; b=1; for (i=1, 3, if (Palin(p), b=0; break); p=Rev(p) + p); if (b && Palin(p), write("b065208.txt", n++, " ", m); if (n==1000, return)) ) } \\ Harry J. Smith, Oct 14 2009
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Klaus Brockhaus, Oct 21 2001
EXTENSIONS
OFFSET changed from 0,1 to 1,1 by Harry J. Smith, Oct 14 2009
More terms from Harvey P. Dale, Nov 26 2010
STATUS
approved