%I #7 Jul 21 2017 02:42:34
%S 1,2,4,2,16,8,72,36,12,432,216,72,2880,1440,576,144,23040,11520,4608,
%T 1152,201600,100800,43200,14400,2880,2016000,1008000,432000,144000,
%U 28800,21772800,10886400,4838400,1814400,518400,86400,261273600
%N Triangle read by rows: T(n,k) is the number of permutations of {1,2,...,n} with maximal number of initial entries of the same parity equal to k (1 <= k <= ceiling(n/2)).
%C Sum of entries in row n is n! = A000142(n).
%C Row n contains ceiling(n/2) entries.
%D E. Deutsch and J. H. Nieto, Mathematics Magazine, Problem 1823, Vol. 83, No. 3, 2010, pp. 230-231. [From _Emeric Deutsch_, Aug 12 2010]
%F a(2n,k) = 2nk!(2n-k-1)!binomial(n,k);
%F a(2n+1,k) = n!(n+1)!*binomial(2n-k+1,n).
%F From _Emeric Deutsch_, Aug 12 2010: (Start)
%F T(n,k) = (ceiling(n/2)*binomial(floor(n/2),k) + floor(n/2)*binomial(ceiling(n/2),k))*k!*(n-k-1)! (from J. H. Nieto's solution).
%F (End)
%e T(4,2)=8 because we have 1324, 1342, 3124, 3142, 2413, 2431, 4213 and 4231.
%e T(5,3)=12 because the first 3 entries form a permutation of (1,3,5) (6 choices) and the last 2 entries form a permutation of {2,4} (2 choices).
%e Triangle starts:
%e 1;
%e 2;
%e 4, 2;
%e 16, 8;
%e 72, 36, 12;
%e 432, 216, 72;
%p ae := proc (n, k) options operator, arrow: 2*n*factorial(k)*factorial(2*n-k-1)*binomial(n, k) end proc: ao := proc (n, k) options operator, arrow: factorial(n)*factorial(n+1)*binomial(2*n-k+1, n) end proc: a := proc (n, k) if `mod`(n, 2) = 0 and k <= (1/2)*n then ae((1/2)*n, k) elif `mod`(n, 2) = 1 and k <= ceil((1/2)*n) then ao((1/2)*n-1/2, k) else 0 end if end proc: for n to 12 do seq(a(n, k), k = 1 .. ceil((1/2)*n)) end do; # yields sequence in triangular form
%Y Cf. A000142.
%K nonn,tabf
%O 1,2
%A _Emeric Deutsch_, Dec 26 2008
|