login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A065208 Three 'Reverse and Add' steps are needed to reach a palindrome. 3

%I #12 Mar 23 2014 03:18:07

%S 59,68,86,95,155,156,157,158,164,165,168,178,180,184,185,186,194,199,

%T 249,254,255,256,257,263,264,267,277,283,284,285,293,298,299,348,349,

%U 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

%N Three 'Reverse and Add' steps are needed to reach a palindrome.

%C The number of steps starts at 0, so palindromes (cf. A002113) are excluded.

%H Harry J. Smith, <a href="/A065208/b065208.txt">Table of n, a(n) for n=1,...,1000</a>

%H <a href="/index/Res#RAA">Index entries for sequences related to Reverse and Add!</a>

%t palQ[n_]:=Module[{idn=IntegerDigits[n]},idn==Reverse[idn]]

%t tst[n_]:=palQ/@NestList[#+FromDigits[Reverse[IntegerDigits[#]]]&,n,3]=={False,False,False,True}

%t Select[Range[750],tst] (* _Harvey P. Dale_, Nov 26 2010 *)

%o (ARIBAS): revadd_steps(3,54). For the definition of function revadd_steps see A065206.

%o (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

%Y A002113, A015979, A065206.

%K nonn,base

%O 1,1

%A _Klaus Brockhaus_, Oct 21 2001

%E OFFSET changed from 0,1 to 1,1 by _Harry J. Smith_, Oct 14 2009

%E More terms from _Harvey P. Dale_, Nov 26 2010

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 16:52 EDT 2024. Contains 371794 sequences. (Running on oeis4.)