OFFSET
1,2
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).
Since (n+1)/2 is the median of {1..n}, this sequence counts "transitive" set partitions.
EXAMPLE
The a(1) = 1 through a(4) = 9 set partitions:
{{1}} {{12}} {{123}} {{1234}}
{{1}{2}} {{13}{2}} {{12}{34}}
{{1}{2}{3}} {{124}{3}}
{{13}{24}}
{{134}{2}}
{{14}{23}}
{{1}{23}{4}}
{{14}{2}{3}}
{{1}{2}{3}{4}}
The set partition {{1,4},{2,3}} has medians {5/2,5/2}, with median 5/2, so is counted under a(4).
The set partition {{1,3},{2,4}} has medians {2,3}, with median 5/2, 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]], (n+1)/2==Median[Median/@#]&]], {n, 6}]
KEYWORD
nonn,more
AUTHOR
Gus Wiseman, Apr 04 2023
STATUS
approved