OFFSET
0,5
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).
FORMULA
a(n) = A079309(floor(n/2)). - Alois P. Heinz, Apr 11 2023
EXAMPLE
The subset {1,2,3,5} of {1..5} has median 5/2, so is counted under a(5).
The subset {2,3,5} of {1..6} has median 6/2, so is counted under a(6).
The a(0) = 0 through a(7) = 14 subsets:
. . {1} {1,2} {2} {1,4} {3} {1,6}
{1,3} {2,3} {1,5} {2,5}
{1,2,3} {1,2,3,4} {2,4} {3,4}
{1,2,4} {1,2,3,5} {1,3,4} {1,2,5,6}
{1,3,5} {1,2,5,7}
{1,3,6} {1,3,4,5}
{2,3,4} {1,3,4,6}
{2,3,5} {1,3,4,7}
{2,3,6} {2,3,4,5}
{1,2,4,5} {2,3,4,6}
{1,2,4,6} {2,3,4,7}
{1,2,3,4,5} {1,2,3,4,5,6}
{1,2,3,4,6} {1,2,3,4,5,7}
{1,2,3,5,6} {1,2,3,4,6,7}
MATHEMATICA
Table[Length[Select[Subsets[Range[n]], Median[#]==n/2&]], {n, 0, 10}]
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Gus Wiseman, Apr 07 2023
STATUS
approved