OFFSET
1,3
COMMENTS
The median of a multiset is either the middle part (for odd length), or the average of the two middle parts (for even length).
EXAMPLE
The a(1) = 1 through a(4) = 6 set partitions:
{{1}} . {{123}} {{1}{234}}
{{13}{2}} {{123}{4}}
{{1}{2}{3}} {{1}{2}{34}}
{{12}{3}{4}}
{{1}{24}{3}}
{{13}{2}{4}}
The set partition {{1,2},{3},{4}} has block-medians {3/2,3,4}, with median 3, so is counted under a(4).
MATHEMATICA
sps[{}]:={{}}; sps[set:{i_, ___}]:=Join@@Function[s, Prepend[#, s]& /@ sps[Complement[set, s]]]/@Cases[Subsets[set], {i, ___}];
Table[Length[Select[sps[Range[n]], IntegerQ[Median[Median/@#]]&]], {n, 6}]
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Gus Wiseman, Apr 04 2023
STATUS
approved