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) = 10 set partitions:
{{1}} {{1}{2}} {{123}} {{1}{234}}
{{13}{2}} {{12}{34}}
{{1}{2}{3}} {{123}{4}}
{{124}{3}}
{{13}{24}}
{{134}{2}}
{{14}{23}}
{{1}{24}{3}}
{{13}{2}{4}}
{{1}{2}{3}{4}}
The set partition {{1,4},{2,3}} has medians {5/2,5/2}, with sum 5, 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[Total[Median/@#]]&]], {n, 10}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Gus Wiseman, Apr 14 2023
EXTENSIONS
a(12)-a(25) from Christian Sievers, Aug 26 2024
STATUS
approved