login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A152660
Triangle read by rows: T(n,k) is the number of permutations of [n] for which k is the maximal number of initial entries whose parities alternate (1 <= k <= n).
1
1, 0, 2, 2, 2, 2, 8, 8, 0, 8, 48, 36, 12, 12, 12, 288, 216, 72, 72, 0, 72, 2160, 1440, 576, 432, 144, 144, 144, 17280, 11520, 4608, 3456, 1152, 1152, 0, 1152, 161280, 100800, 43200, 28800, 11520, 8640, 2880, 2880, 2880, 1612800, 1008000, 432000, 288000, 115200, 86400, 28800, 28800, 0, 28800
OFFSET
1,3
COMMENTS
Sum of entries in row n is n! (=A000142(n)).
T(n,n) = A092186(n) (the parity alternating permutations; see the Tanimoto reference).
T(n,1) = A152661(n).
FORMULA
T(2n,k) = 2(n!)^2*binomial(2n-k-1, n-floor(k/2));
T(2n+1,2k) = n!(n+1)!*binomial(2n-2k+1, n-k);
T(2n+1,2k+1) = n!(n+1)!*binomial(2n-2k, n-k-1) if k < n;
T(2n+1,2n+1) = n!(n+1)!.
EXAMPLE
T(4,2)=8 because we have 1243, 1423, 2134, 2314, 3241, 3421, 4132 and 4312.
Triangle starts:
1;
0, 2;
2, 2, 2;
8, 8, 0, 8;
48, 36, 12, 12, 12;
288, 216, 72, 72, 0, 72;
MAPLE
T := proc (n, k) if n < k then 0 elif `mod`(n, 2) = 0 and `mod`(k, 2) = 0 then 2*factorial((1/2)*n)^2*binomial(n-k-1, (1/2)*n-(1/2)*k) elif `mod`(n, 2) = 0 and `mod`(k, 2) = 1 then 2*factorial((1/2)*n)^2*binomial(n-k-1, (1/2)*n-(1/2)*k+1/2) elif `mod`(n, 2) = 1 and `mod`(k, 2) = 0 then factorial((1/2)*n-1/2)*factorial((1/2)*n+1/2)*binomial(n-k, (1/2)*n-(1/2)*k-1/2) elif `mod`(n, 2) = 1 and k = n then factorial((1/2)*n-1/2)*factorial((1/2)*n+1/2) else factorial((1/2)*n-1/2)*factorial((1/2)*n+1/2)*binomial(n-k, (1/2)*n-(1/2)*k-1) end if end proc: for n to 10 do seq(T(n, k), k = 1 .. n) end do; # yields sequence in triangular form
MATHEMATICA
T[n0_?EvenQ, k_] := With[{n = n0/2}, 2 (n!)^2*Binomial[2 n - k - 1, n - Floor[k/2]]];
T[n1_?OddQ, k0_?EvenQ] := With[{n = (n1 - 1)/2, k = k0/2}, n! (n + 1)! * Binomial[2 n - 2 k + 1, n - k] ];
T[n1_?OddQ, k1_?OddQ] := With[{n = (n1 - 1)/2, k = (k1 - 1)/2}, n! (n+1)! * Binomial[2 n - 2 k, n - k - 1] ];
T[n1_?OddQ, n1_?OddQ] := With[{n = (n1 - 1)/2}, n! (n + 1)!];
Table[T[n, k], {n, 1, 10}, {k, 1, n}] // Flatten (* Jean-François Alcover, Nov 28 2017 *)
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Emeric Deutsch, Dec 12 2008
STATUS
approved