OFFSET
0,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..20000
P. C. P. Bhatt, An interesting way to partition a number, Inform. Process. Lett., 71, 1999, 141-148.
W. M. Y. Goh, P. Hitczenko and A. Shokoufandeh, s-partitions, Inform. Process. Lett., 82, 2002, 327-329.
FORMULA
a(n) = Sum_{k=1..n} k*A117145(n,k).
G.f.: sum(x^(2^k-1)/(1-x^(2^k-1)), k=1..infinity)/product(1-x^(2^k-1), k=1..infinity).
EXAMPLE
a(7) = 16 because the s-partitions of 7 are [7],[3,3,1],[3,1,1,1,1] and [1,1,1,1,1,1,1], with a total of 1 + 3 + 5 + 7 = 16 parts.
MAPLE
g:=sum(x^(2^k-1)/(1-x^(2^k-1)), k=1..10)/product(1-x^(2^k-1), k=1..10): gser:=series(g, x, 60): seq(coeff(gser, x, n), n=0..56);
# Alternative:
b:= proc(n, i) option remember; `if`(n=0, [1, 0], `if`(i<1, 0,
b(n, i-1)+(p-> `if`(p>n, 0, (f-> f+[0, f[1]])(b(n-p, i))))(2^i-1)))
end:
a:= n-> b(n, 1+ilog2(n))[2]:
seq(a(n), n=0..52); # Alois P. Heinz, Oct 01 2025
MATHEMATICA
b[n_, i_] := b[n, i] = Which[n == 0, {1, 0}, i < 1, 0, True, b[n, i-1] + Function[p, If[p > n, 0, Function[f, f + {0, f[[1]]}][b[n-p, i]]]][2^i-1]];
a[n_] := b[n, Length[IntegerDigits[n, 2]]][[2]];
Table[a[n], {n, 0, 52}] (* Jean-François Alcover, Mar 03 2026, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Emeric Deutsch, Mar 06 2006
EXTENSIONS
Missing a(0)=0 inserted by Alois P. Heinz, Oct 01 2025
STATUS
approved
