cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A361863 Number of set partitions of {1..n} such that the median of medians of the blocks is (n+1)/2.

Original entry on oeis.org

1, 2, 3, 9, 26, 69, 335, 1018, 6629, 22805, 182988, 703745
Offset: 1

Views

Author

Gus Wiseman, Apr 04 2023

Keywords

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.

Examples

			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).
		

Crossrefs

For mean instead of median we have A361910.
A000110 counts set partitions.
A000975 counts subsets with integer median, mean A327475.
A013580 appears to count subsets by median, A327481 by mean.
A325347 counts partitions w/ integer median, complement A307683.
A359893 and A359901 count partitions by median, odd-length A359902.
A360005 gives twice median of prime indices, distinct A360457.
A361864 counts set partitions with integer median of medians, means A361865.
A361866 counts set partitions with integer sum of medians, means A361911.

Programs

  • 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}]