|
|
A339427
|
|
Number of compositions (ordered partitions) of n into an odd number of powers of 2.
|
|
1
|
|
|
0, 1, 1, 1, 4, 4, 9, 17, 26, 50, 88, 150, 274, 478, 841, 1497, 2634, 4650, 8234, 14518, 25654, 45340, 80040, 141414, 249822, 441192, 779422, 1376752, 2431772, 4295678, 7587761, 13402881, 23675186, 41819442, 73869802, 130483966, 230485902, 407130212, 719154602
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,5
|
|
LINKS
|
|
|
FORMULA
|
G.f.: (1/2) * (1 / (1 - Sum_{k>=0} x^(2^k)) - 1 / (1 + Sum_{k>=0} x^(2^k))).
|
|
EXAMPLE
|
a(5) = 4 because we have [2, 2, 1], [2, 1, 2], [1, 2, 2] and [1, 1, 1, 1, 1].
|
|
MAPLE
|
b:= proc(n, t) option remember; `if`(n=0, t,
add(b(n-2^i, 1-t), i=0..ilog2(n)))
end:
a:= n-> b(n, 0):
|
|
MATHEMATICA
|
nmax = 38; CoefficientList[Series[(1/2) (1/(1 - Sum[x^(2^k), {k, 0, Floor[Log[2, nmax]] + 1}]) - 1/(1 + Sum[x^(2^k), {k, 0, Floor[Log[2, nmax]] + 1}])), {x, 0, nmax}], x]
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|