login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A066133 In base 2, twelve 'Reverse and Add' steps are needed to reach a palindrome. 1
1027, 1139, 1181, 1229, 1433, 1481, 1537, 1649, 1951, 1983, 1999, 2031, 2051, 3073, 3103, 3215, 3351, 3463, 3611, 3639, 3671, 3723, 3751, 3783, 3839, 3859, 3971, 4087, 4103, 4121, 4141, 4187, 4237, 4269, 4327, 4331, 4333, 4361, 4427, 4603, 4625, 4645 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

COMMENTS

The analog of A065217 in base 2. The number of steps starts at 0, so palindromes (cf. A006995) are excluded.

LINKS

Harry J. Smith, Table of n, a(n) for n=1..1000

Index entries for sequences related to Reverse and Add!

PROG

(PARI) Rev(x)= { local(d, r=0); while (x>0, d=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) } baseE(x, b)= { local(d, e=0, f=1); while (x>0, d=x-b*(x\b); x\=b; e+=d*f; f*=10); return(e) } baseI(x, b)= { local(d, e=0, f=1); while (x>0, d=x-10*(x\10); x\=10; e+=d*f; f*=b); return(e) } calcB(p)= { local(b, r); b=baseE(p, 2); r=Rev(b); d=baseI(r, 2) + p; b=baseE(d, 2); return(b); } { n=0; for (m=1, 10^9, d=m; t=1; b=baseE(d, 2); for (i=1, 12, if (Palin(b), t=0; break); b=calcB(d)); if (t && Palin(b), write("b066133.txt", n++, " ", m); if (n==1000, return)) ) } \\ Harry J. Smith, Feb 01 2010

CROSSREFS

Cf. A006995, A065217, A066122.

Sequence in context: A246245 A235692 A247947 * A119455 A252772 A168189

Adjacent sequences:  A066130 A066131 A066132 * A066134 A066135 A066136

KEYWORD

base,nonn

AUTHOR

Klaus Brockhaus, Dec 08 2001

EXTENSIONS

OFFSET changed from 0,1 to 1,1 by Harry J. Smith, Feb 01 2010

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified January 29 04:57 EST 2020. Contains 331335 sequences. (Running on oeis4.)