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

%I #14 Oct 27 2024 03:11:07

%S 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,

%T 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,

%U 25,70,48,66,32,23,7,3,1,12,66,30,95,72,114,64,55,20,10,2,1

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

%C Row sums: A212146.

%e First 7 rows:

%e 1

%e 2...1

%e 3...3....1

%e 4...6....2...1

%e 5...10...4...3....1

%e 6...15...6...7....2...1

%e 7...21...9...13...5...3...1

%e T(5,3) counts these subsets: {1,2,3}, {1,3,5}, {2,3,4}, {3,4,5}.

%t t[n_, k_] := t[n, k] = Count[Map[Median[#] == Mean[#] &, Subsets[Range[n], {k}]], True]

%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, 22}] (* A212146 *)

%t (% - 1)/2 (* A212147 *)

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

%Y Cf. A212138.

%K nonn,tabl

%O 1,2

%A _Clark Kimberling_, May 06 2012