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

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A162951 a(1)=0. a(n) is the smallest integer > a(n-1) such that both a(n) and a(n)-a(n-1) have the same number of 1's when written in binary as n has when it is written in binary. 0
 0, 1, 6, 8, 17, 20, 41 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,3 COMMENTS a(7)=41 is the final term because 8 has one binary 1, which means that a(8), if it existed, must be a power of 2, and a(8)-41 must be a power of 2. Since no two powers of 2 have a difference of 41, then the sequence has only 7 terms. LINKS MATHEMATICA nxt[{n_, a_}]:=Module[{k=a+1}, While[DigitCount[n+1, 2, 1] != DigitCount[k, 2, 1] || DigitCount[k, 2, 1] != DigitCount[k-a, 2, 1], k++]; {n+1, k}]; Transpose[ NestList[nxt, {1, 0}, 6]][[2]] (* Harvey P. Dale, Dec 07 2012 *) CROSSREFS Sequence in context: A127400 A315941 A025081 * A032411 A345034 A058098 Adjacent sequences:  A162948 A162949 A162950 * A162952 A162953 A162954 KEYWORD fini,full,nonn AUTHOR Leroy Quet, Jul 18 2009 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.

Last modified September 22 08:23 EDT 2021. Contains 347605 sequences. (Running on oeis4.)