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-4 of 4 results.

A212146 Number of subsets of {1,...,n} having mean=median.

Original entry on oeis.org

1, 3, 7, 13, 23, 37, 59, 91, 141, 217, 341, 541, 879, 1453, 2455, 4217, 7371, 13047, 23375, 42259, 77027, 141299, 260695, 483221, 899471, 1680269, 3149075, 5918701, 11153461, 21067693, 39881625, 75647719, 143756049, 273654821, 521769373, 996334961, 1905214687
Offset: 1

Views

Author

Clark Kimberling, May 06 2012

Keywords

Comments

a(n) = sum of terms of row n of the triangle A212139.
a(n) = 1+2*A212147(n).

Crossrefs

Cf. A212138.

Programs

  • Mathematica
    t[n_, k_] := t[n, k] = Count[Map[Median[#] == Mean[#] &, Subsets[Range[n], {k}]], True]
    Flatten[Table[t[n, k], {n, 1, 12}, {k, 1, n}]]  (* A212139 *)
    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, 22}]   (* A212146 *)
    (% - 1)/2                 (* A212147 *)
    (* Peter J. C. Moses, May 01 2012 *)

Extensions

a(23) from Alois P. Heinz, Feb 12 2014
a(24)-a(37) from Hiroaki Yamanouchi, Oct 03 2014

A212147 a(n) = (A212146(n)-1)/2.

Original entry on oeis.org

0, 1, 3, 6, 11, 18, 29, 45, 70, 108, 170, 270, 439, 726, 1227, 2108, 3685, 6523, 11687, 21129, 38513, 70649, 130347, 241610, 449735, 840134, 1574537, 2959350, 5576730, 10533846, 19940812, 37823859, 71878024, 136827410, 260884686, 498167480, 952607343
Offset: 1

Views

Author

Clark Kimberling, May 06 2012

Keywords

Comments

A212146(n) is the number of subsets of {1,...,n} having mean=median.

Crossrefs

Cf. A212138.

Programs

  • Mathematica
    t[n_, k_] := t[n, k] = Count[Map[Median[#] == Mean[#] &, Subsets[Range[n], {k}]], True]
    Flatten[Table[t[n, k], {n, 1, 12}, {k, 1, n}]]  (* A212139 *)
    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, 22}]   (* A212146 *)
    (% - 1)/2                 (* A212147 *)
    (* Peter J. C. Moses, May 01 2012 *)

Extensions

a(23)-a(37) from Hiroaki Yamanouchi, Oct 03 2014

A212149 Number of k-element subsets S of {1,...,n} such that mean(S)

Original entry on oeis.org

0, 0, 0, 1, 4, 13, 34, 82, 185, 403, 853, 1777, 3656, 7465, 15156, 30659, 61850, 124548, 250456, 503158
Offset: 1

Views

Author

Clark Kimberling, May 06 2012

Keywords

Comments

Also the number of k-element subsets S of {1,...,n} such that mean(S)>median(S). A212149(n) = A212140(n)/2.

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-4 of 4 results.