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.

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

A212139 Triangular array: T(n,k) is the number of k-element subsets of {1,...,n} that satisfy mean=median.

Original entry on oeis.org

1, 2, 1, 3, 3, 1, 4, 6, 2, 1, 5, 10, 4, 3, 1, 6, 15, 6, 7, 2, 1, 7, 21, 9, 13, 5, 3, 1, 8, 28, 12, 22, 10, 8, 2, 1, 9, 36, 16, 34, 18, 18, 6, 3, 1, 10, 45, 20, 50, 30, 36, 14, 9, 2, 1, 11, 55, 25, 70, 48, 66, 32, 23, 7, 3, 1, 12, 66, 30, 95, 72, 114, 64, 55, 20, 10, 2, 1
Offset: 1

Views

Author

Clark Kimberling, May 06 2012

Keywords

Comments

Row sums: A212146.

Examples

			First 7 rows:
  1
  2...1
  3...3....1
  4...6....2...1
  5...10...4...3....1
  6...15...6...7....2...1
  7...21...9...13...5...3...1
T(5,3) counts these subsets: {1,2,3}, {1,3,5}, {2,3,4}, {3,4,5}.
		

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}]]
    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 *)
Showing 1-2 of 2 results.