login
A309674
a(1) = 1, a(n) = hamming_weight(Sum_{k=1..n-1} a(k) ) for n>=2.
1
1, 1, 1, 2, 2, 3, 2, 2, 3, 2, 3, 3, 3, 3, 5, 2, 3, 3, 3, 5, 3, 5, 4, 1, 2, 3, 3, 3, 3, 5, 3, 5, 4, 2, 3, 4, 4, 5, 4, 5, 6, 2, 3, 3, 3, 3, 5, 3, 5, 4, 2, 3, 4, 4, 5, 4, 5, 6, 3, 3, 5, 4, 3, 5, 4, 5, 4, 5, 5, 7, 6, 6, 2, 2, 3, 3, 3, 5, 3, 5, 4, 2, 3, 4, 4, 5, 4, 5, 6, 3, 3, 5, 4, 3, 5, 4, 5, 4, 5, 5, 7, 6, 6
OFFSET
1,4
LINKS
FORMULA
a(n) = A010062(n-1) - A010062(n-2) for n>1. - Jon Maiga, Aug 30 2019
MAPLE
b:= proc(n) option remember; `if`(n=0, 0, a(n)+b(n-1)) end:
a:= n-> `if`(n=1, 1, add(i, i=Bits[Split](b(n-1)))):
seq(a(n), n=1..120); # Alois P. Heinz, Aug 30 2019
MATHEMATICA
a[1] = 1; s[n_] := Sum[a[k], {k, 1, n - 1}]; a[n_] := a[n] = DigitCount[s[n], 2, 1]; Array[a, 100] (* Amiram Eldar, Jul 27 2023 *)
PROG
(PARI) { my(s=0, t=1); for(j=1, 100, print1(t, ", "); s+=t; t=hammingweight(s)); } \\ Joerg Arndt, Aug 30 2019
CROSSREFS
Sequence in context: A125954 A122443 A262945 * A270516 A099318 A187128
KEYWORD
nonn,base
AUTHOR
Petr Stanicek, Aug 22 2019
STATUS
approved