OFFSET
0,3
COMMENTS
Sets of 1 or 2 members are always allowed.
EXAMPLE
a(4) = 11 because there are 11 such partitions of [1,2,3,4]:
[1], [2], [3], [4]
[3], [1,2,4]
3 partitions into two sets of 2 members, such as [1,2], [3,4]
6 partitions into two sets of 1 member and one of 2 members, such as [1],[2],[3,4].
MAPLE
f:= proc(S, s) option remember;
local i;
# set of sublists of list S summing to <= s
if s < 0 then return {} fi;
if s = 0 then return {[]} fi;
`union`({[]}, seq(map(t -> [op(t), S[i]], procname(S[1..i-1], s-S[i])), i=1..nops(S)))
end proc:
h:= proc(L)
# partitions of L into lists with one member > sum of the others
option remember;
local V, S, R;
if L=[] then return {{}} fi;
V:= f(L[1..-2], L[-1]-1);
R:= NULL:
for S in V do
if S = L[1..-2] then R:= R, {L}
else R:= R, op(map(t -> t union {[op(S), L[-1]]}, procname(remove(t -> member(t, S), L[1..-2]))))
fi od;
{R};
end proc:
seq(nops(h([$1..n])), n=0..14);
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert Israel, Aug 22 2024
EXTENSIONS
a(15)-a(26) from Alois P. Heinz, Aug 22 2024
STATUS
approved