OFFSET
0,4
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..10000
EXAMPLE
a(5) = 7 counts the 1's in [101], [100, 1], [11, 10].
MAPLE
h:= proc(n) option remember; add(i, i=Bits[Split](n)) end:
b:= proc(n, i) option remember; `if`(n=0, [1, 0],
`if`(n>i*(i+1)/2, 0, b(n, i-1)+(p-> p+
[0, p[1]*h(i)])(b(n-i, min(n-i, i-1)))))
end:
a:= n-> b(n$2)[2]:
seq(a(n), n=0..60);
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Alois P. Heinz, Aug 14 2021
STATUS
approved