login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A323355
a(1)=1; for n >= 2, a(n) = Sum_{i=1..A000120(n)} a(z(i)), where z(i) are the positions of 1's in the binary expansion of n, counted from left to right.
2
1, 1, 2, 1, 3, 2, 4, 1, 2, 3, 4, 2, 3, 4, 5, 1, 4, 2, 5, 3, 6, 4, 7, 2, 5, 3, 6, 4, 7, 5, 8, 1, 3, 4, 6, 2, 4, 5, 7, 3, 5, 6, 8, 4, 6, 7, 9, 2, 4, 5, 7, 3, 5, 6, 8, 4, 6, 7, 9, 5, 7, 8, 10, 1, 5, 3, 7, 4, 8, 6, 10, 2, 6, 4, 8, 5, 9, 7, 11, 3, 7, 5, 9, 6, 10, 8, 12, 4, 8, 6, 10, 7, 11, 9, 13, 2, 6, 4
OFFSET
1,3
LINKS
EXAMPLE
n=13, decimal 13 is 1101 in binary, the 1's are at positions 1,2,4. So a(13) = a(1) + a(2) + a(4).
MATHEMATICA
a[1] = 1; a[n_] := a[n] = Total[a /@ (Position[IntegerDigits[n, 2], 1] // Flatten)]; Array[a, 100] (* Amiram Eldar, Jul 24 2023 *)
PROG
(PARI) lista(nn) = {my(va = vector(nn), vb); va[1] = 1; for (n=2, nn, vb = binary(n); va[n] = sum(k=1, #vb, vb[k]*va[k]); ); va; } \\ Michel Marcus, Jan 12 2019
CROSSREFS
Sequence in context: A363489 A363944 A367581 * A367587 A363942 A363487
KEYWORD
base,nonn
AUTHOR
Ctibor O. Zizka, Jan 12 2019
STATUS
approved