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

%I #10 Feb 12 2014 21:55:04

%S 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 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 0,0,140,260,414,396,298,142,48,8,0,0,0,190,400,720,810,728,440

%N 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 Row sums: A212140.

%e First 7 rows:

%e 0

%e 0...0

%e 0...0...0

%e 0...0...2....0

%e 0...0...6....2....0

%e 0...0...14...8....4...0

%e 0...0...26...22...16...4...0

%e 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 t[n_, k_] := t[n, k] = Count[Map[Median[#] == Mean[#] &, Subsets[Range[n], {k}]], False]

%t Flatten[Table[t[n, k], {n, 1, 12}, {k, 1, n}]]

%t TableForm[Table[t[n, k], {n, 1, 12}, {k, 1, n}]]

%t s[n_] := Sum[t[n, k], {k, 1, n}]

%t Table[s[n], {n, 1, 20}] (* A212140 *)

%t %/2 (* A212149 *)

%t (* _Peter J. C. Moses_, May 01 2012 *)

%Y Cf. A212139.

%K nonn,tabl

%O 1,9

%A _Clark Kimberling_, May 06 2012