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.

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