login
A320768
Number of set partitions of the set of nonempty subsets of {1,...,n} using set partitions.
2
1, 1, 2, 15, 2420
OFFSET
0,3
EXAMPLE
The a(3) = 15 set partitions:
{{{1}},{{2}},{{3}},{{1,2}},{{1,3}},{{2,3}},{{1,2,3}}}
{{{1}},{{2}},{{3},{1,2}},{{1,3}},{{2,3}},{{1,2,3}}}
{{{1}},{{2},{3}},{{1,2}},{{1,3}},{{2,3}},{{1,2,3}}}
{{{1}},{{2},{1,3}},{{3}},{{1,2}},{{2,3}},{{1,2,3}}}
{{{1}},{{2},{1,3}},{{3},{1,2}},{{2,3}},{{1,2,3}}}
{{{1},{2}},{{3}},{{1,2}},{{1,3}},{{2,3}},{{1,2,3}}}
{{{1},{2}},{{3},{1,2}},{{1,3}},{{2,3}},{{1,2,3}}}
{{{1},{3}},{{2}},{{1,2}},{{1,3}},{{2,3}},{{1,2,3}}}
{{{1},{3}},{{2},{1,3}},{{1,2}},{{2,3}},{{1,2,3}}}
{{{1},{2,3}},{{2}},{{3}},{{1,2}},{{1,3}},{{1,2,3}}}
{{{1},{2,3}},{{2}},{{3},{1,2}},{{1,3}},{{1,2,3}}}
{{{1},{2,3}},{{2},{3}},{{1,2}},{{1,3}},{{1,2,3}}}
{{{1},{2,3}},{{2},{1,3}},{{3}},{{1,2}},{{1,2,3}}}
{{{1},{2,3}},{{2},{1,3}},{{3},{1,2}},{{1,2,3}}}
{{{1},{2},{3}},{{1,2}},{{1,3}},{{2,3}},{{1,2,3}}}
MATHEMATICA
spsu[_, {}]:={{}}; spsu[foo_, set:{i_, ___}]:=Join@@Function[s, Prepend[#, s]&/@spsu[Select[foo, Complement[#, Complement[set, s]]=={}&], Complement[set, s]]]/@Cases[foo, {i, ___}];
sps[set_]:=spsu[Rest[Subsets[set]], set];
Table[Length[spsu[Sort/@Union@@sps/@Rest[Subsets[Range[n]]], Rest[Subsets[Range[n]]]]], {n, 4}]
KEYWORD
nonn,more
AUTHOR
Gus Wiseman, Dec 09 2018
STATUS
approved