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.

Showing 1-2 of 2 results.

A212140 Number of k-element subsets S of {1,...,n} such that mean(S) is not equal to median(S).

Original entry on oeis.org

0, 0, 0, 2, 8, 26, 68, 164, 370, 806, 1706, 3554, 7312, 14930, 30312, 61318, 123700, 249096, 500912, 1006316
Offset: 1

Views

Author

Clark Kimberling, May 06 2012

Keywords

Comments

Row sums of the triangular array at A212148.

Crossrefs

Programs

  • Mathematica
    t[n_, k_] := t[n, k] = Count[Map[Median[#] == Mean[#] &, Subsets[Range[n], {k}]], False]
    Flatten[Table[t[n, k], {n, 1, 12}, {k, 1, n}]]
    TableForm[Table[t[n, k], {n, 1, 12}, {k, 1, n}]]
    s[n_] := Sum[t[n, k], {k, 1, n}]
    Table[s[n], {n, 1, 20}] (* A212140 *)
    %/2                     (* A212149 *)
    (* Peter J. C. Moses, May 01 2012 *)

A212148 Triangular array: T(n,k) is the number of k-element subsets S of {1,...,n} such that mean(S) is not equal to median(S).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 6, 2, 0, 0, 0, 14, 8, 4, 0, 0, 0, 26, 22, 16, 4, 0, 0, 0, 44, 48, 46, 20, 6, 0, 0, 0, 68, 92, 108, 66, 30, 6, 0, 0, 0, 100, 160, 222, 174, 106, 36, 8, 0, 0, 0, 140, 260, 414, 396, 298, 142, 48, 8, 0, 0, 0, 190, 400, 720, 810, 728, 440
Offset: 1

Views

Author

Clark Kimberling, May 06 2012

Keywords

Comments

Row sums: A212140.

Examples

			First 7 rows:
0
0...0
0...0...0
0...0...2....0
0...0...6....2....0
0...0...14...8....4...0
0...0...26...22...16...4...0
The subsets counted by T(5,3) are {1,2,4}, {1,2,5}, {1,3,4}, {1,4,5}, {2,3,5}, {2,4,5}.
		

Crossrefs

Cf. A212139.

Programs

  • Mathematica
    t[n_, k_] := t[n, k] = Count[Map[Median[#] == Mean[#] &, Subsets[Range[n], {k}]], False]
    Flatten[Table[t[n, k], {n, 1, 12}, {k, 1, n}]]
    TableForm[Table[t[n, k], {n, 1, 12}, {k, 1, n}]]
    s[n_] := Sum[t[n, k], {k, 1, n}]
    Table[s[n], {n, 1, 20}] (* A212140 *)
    %/2                     (* A212149 *)
    (* Peter J. C. Moses, May 01 2012 *)
Showing 1-2 of 2 results.