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

A357534
Number of compositions (ordered partitions) of n into two or more powers of 2.
1
0, 0, 1, 3, 5, 10, 18, 31, 55, 98, 174, 306, 542, 956, 1690, 2983, 5271, 9310, 16448, 29050, 51318, 90644, 160118, 282826, 499590, 882468, 1558798, 2753448, 4863696, 8591212, 15175514, 26805983, 47350055, 83639030, 147739848, 260967362, 460972286, 814260544, 1438308328
OFFSET
0,4
FORMULA
a(n) = A023359(n) - A209229(n) for n > 0.
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