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).
A mode in a multiset is an element that appears at least as many times as each of the others. For example, the modes in {a,a,b,b,b,c,d,d,d} are {b,d}.
EXAMPLE
The a(1) = 1 through a(8) = 15 partitions:
(1) (2) (3) (4) (5) (6) (7) (8)
(11) (111) (22) (221) (33) (322) (44)
(211) (311) (222) (331) (332)
(1111) (2111) (411) (511) (422)
(11111) (3111) (2221) (611)
(21111) (4111) (2222)
(111111) (22111) (3221)
(31111) (5111)
(211111) (22211)
(1111111) (32111)
(41111)
(221111)
(311111)
(2111111)
(11111111)
MATHEMATICA
modes[ms_]:=Select[Union[ms], Count[ms, #]>=Max@@Length/@Split[ms]&];
Table[Length[Select[IntegerPartitions[n], {Median[#]}==modes[#]&]], {n, 30}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Gus Wiseman, Jun 26 2023
STATUS
approved