OFFSET
0,4
MAPLE
b:= proc(n) option remember;
`if`(n=0, 1, add(b(n-2^i), i=0..ilog2(n)))
end:
a:= n-> b(n)-`if`(2^ilog2(n)=n, 1, 0):
seq(a(n), n=0..50); # Alois P. Heinz, Oct 02 2022
MATHEMATICA
b[n_] := b[n] = If[n == 0, 1, Sum[b[n - 2^i], {i, 0, Floor@ Log2[n]}]];
a[n_] := b[n] - If[2^Floor@Log2[n] == n, 1, 0];
Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Dec 26 2022, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Oct 02 2022
STATUS
approved