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.

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

This page as a plain text file.
%I A212148 #10 Feb 12 2014 21:55:04
%S A212148 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,
%T A212148 48,46,20,6,0,0,0,68,92,108,66,30,6,0,0,0,100,160,222,174,106,36,8,0,
%U A212148 0,0,140,260,414,396,298,142,48,8,0,0,0,190,400,720,810,728,440
%N 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).
%C A212148 Row sums:  A212140.
%e A212148 First 7 rows:
%e A212148 0
%e A212148 0...0
%e A212148 0...0...0
%e A212148 0...0...2....0
%e A212148 0...0...6....2....0
%e A212148 0...0...14...8....4...0
%e A212148 0...0...26...22...16...4...0
%e A212148 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}.
%t A212148 t[n_, k_] := t[n, k] = Count[Map[Median[#] == Mean[#] &, Subsets[Range[n], {k}]], False]
%t A212148 Flatten[Table[t[n, k], {n, 1, 12}, {k, 1, n}]]
%t A212148 TableForm[Table[t[n, k], {n, 1, 12}, {k, 1, n}]]
%t A212148 s[n_] := Sum[t[n, k], {k, 1, n}]
%t A212148 Table[s[n], {n, 1, 20}] (* A212140 *)
%t A212148 %/2                     (* A212149 *)
%t A212148 (* _Peter J. C. Moses_, May 01 2012 *)
%Y A212148 Cf. A212139.
%K A212148 nonn,tabl
%O A212148 1,9
%A A212148 _Clark Kimberling_, May 06 2012