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”).

A260956
a(0)=1; a(n) = Sum_{k=1..n-1} d(k)*a(n-k), where d(m) is m-th bit in binary expansion of n.
2
1, 1, 1, 2, 2, 3, 5, 10, 10, 13, 23, 43, 66, 122, 231, 462, 462, 528, 759, 1452, 1980, 3201, 5412, 9603, 15015, 26598, 47025, 88638, 162261, 312939, 610863, 1221726, 1221726, 1310364, 1623303, 2547105, 3768831, 6300921, 9234588, 14715360, 21016281, 32797974
OFFSET
0,4
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..4575 (terms n = 1..1000 from Anders Hellström)
MAPLE
a:= proc(n) option remember; `if`(n=0, 1, (l-> add(
a(n-i)*l[-i], i=1..nops(l)))(convert(n, base, 2)))
end:
seq(a(n), n=0..50); # Alois P. Heinz, Jan 18 2019
MATHEMATICA
a[0] = 1; a[n_] := a[n] = Total[(d = IntegerDigits[n, 2]) * Table[a[n - k], {k, 1, Length[d]}]]; Array[a, 50, 0] (* Amiram Eldar, Jul 25 2023 *)
PROG
(PARI) first(m)=my(v=vector(m)); v[1]=1; v[2]=1; for(i=3, m, v[i]=0; d=digits(i, 2); for(j=1, #d, v[i]+=d[j]*v[i-j])); v
(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]*(if (n==k, 1, va[n-k]))); ); concat(1, va); } \\ Michel Marcus, Jan 12 2019
CROSSREFS
Cf. A033639 (when binary digits are taken in the reverse order).
Sequence in context: A374735 A208437 A130377 * A360299 A344708 A322113
KEYWORD
nonn,base
AUTHOR
Anders Hellström, Sep 10 2015
EXTENSIONS
a(0)=1 prepended by Alois P. Heinz, Jan 18 2019
STATUS
approved