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!)
A216685 a(n) is the number of 1's in binary expansion of n + a(n-1), with a(0)=0. 1
0, 1, 2, 2, 2, 3, 2, 2, 2, 3, 3, 3, 4, 2, 1, 1, 2, 3, 3, 3, 4, 3, 3, 3, 4, 4, 4, 5, 2, 5, 3, 2, 2, 3, 3, 3, 4, 3, 3, 3, 4, 4, 4, 5, 3, 2, 2, 3, 4, 4, 4, 5, 4, 4, 4, 5, 5, 5, 6, 2, 5, 2, 1, 1, 2, 3, 3, 3, 4, 3, 3, 3, 4, 4, 4, 5, 3, 2, 2, 3, 4, 4, 4, 5, 4, 4, 4 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
COMMENTS
Indices of 1's: 1, 14, 15, 62, 63, 254, 255, 2045, 4087, 32766, 32767, 65523, 131069, 262129, 524272, 524286, 524287, 2097149, 8388605, 16777195, 16777212, ...
LINKS
FORMULA
a(0) = 0, a(n) = A000120(n+a(n-1)).
MATHEMATICA
a[0] = 0; a[n_] := a[n] = DigitCount[n + a[n - 1], 2, 1]; Array[a, 100, 0] (* Amiram Eldar, Jul 22 2023 *)
PROG
(Python)
a=0
for n in range(1, 333):
print a,
x = a+n
a = 0
while x:
a += x & 1
x >>= 1
CROSSREFS
Cf. A000120.
Sequence in context: A127656 A109709 A125604 * A331853 A187184 A301375
KEYWORD
nonn,base
AUTHOR
Alex Ratushnyak, Sep 14 2012
STATUS
approved

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 July 14 20:49 EDT 2024. Contains 374323 sequences. (Running on oeis4.)