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.

A361654 Triangle read by rows where T(n,k) is the number of nonempty subsets of {1,...,2n-1} with median n and minimum k.

Original entry on oeis.org

1, 2, 1, 5, 3, 1, 15, 9, 4, 1, 50, 29, 14, 5, 1, 176, 99, 49, 20, 6, 1, 638, 351, 175, 76, 27, 7, 1, 2354, 1275, 637, 286, 111, 35, 8, 1, 8789, 4707, 2353, 1078, 441, 155, 44, 9, 1, 33099, 17577, 8788, 4081, 1728, 650, 209, 54, 10, 1
Offset: 1

Views

Author

Gus Wiseman, Mar 23 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).

Examples

			Triangle begins:
     1
     2     1
     5     3     1
    15     9     4     1
    50    29    14     5     1
   176    99    49    20     6     1
   638   351   175    76    27     7     1
  2354  1275   637   286   111    35     8     1
  8789  4707  2353  1078   441   155    44     9     1
Row n = 4 counts the following subsets:
  {1,7}            {2,6}        {3,5}    {4}
  {1,4,5}          {2,4,5}      {3,4,5}
  {1,4,6}          {2,4,6}      {3,4,6}
  {1,4,7}          {2,4,7}      {3,4,7}
  {1,2,6,7}        {2,3,5,6}
  {1,3,5,6}        {2,3,5,7}
  {1,3,5,7}        {2,3,4,5,6}
  {1,2,4,5,6}      {2,3,4,5,7}
  {1,2,4,5,7}      {2,3,4,6,7}
  {1,2,4,6,7}
  {1,3,4,5,6}
  {1,3,4,5,7}
  {1,3,4,6,7}
  {1,2,3,5,6,7}
  {1,2,3,4,5,6,7}
		

Crossrefs

Row sums appear to be A006134.
Column k = 1 appears to be A024718.
Column k = 2 appears to be A006134.
Column k = 3 appears to be A079309.
A000975 counts subsets with integer median, mean A327475.
A007318 counts subsets by length.
A231147 counts subsets by median, full steps A013580, by mean A327481.
A359893 and A359901 count partitions by median.
A360005(n)/2 gives the median statistic.

Programs

  • Mathematica
    Table[Length[Select[Subsets[Range[2n-1]],Min@@#==k&&Median[#]==n&]],{n,6},{k,n}]
  • PARI
    T(n,k) = sum(j=0, n-k, binomial(2*j+k-2, j)) \\ Andrew Howroyd, Apr 09 2023

Formula

T(n,k) = 1 + Sum_{j=1..n-k} binomial(2*j+k-2, j). - Andrew Howroyd, Apr 09 2023