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.

A145894 Triangle read by rows: T(n,k) is the number of permutations p of {1,2,...,n} such that j and p(j) are of the same parity for k values of j (0<=k<=n).

This page as a plain text file.
%I A145894 #18 Jul 12 2024 15:20:23
%S A145894 1,0,1,1,0,1,0,4,0,2,4,0,16,0,4,0,36,0,72,0,12,36,0,324,0,324,0,36,0,
%T A145894 576,0,2592,0,1728,0,144,576,0,9216,0,20736,0,9216,0,576,0,14400,0,
%U A145894 115200,0,172800,0,57600,0,2880,14400,0,360000,0,1440000,0,1440000,0,360000,0,14400
%N A145894 Triangle read by rows: T(n,k) is the number of permutations p of {1,2,...,n} such that j and p(j) are of the same parity for k values of j (0<=k<=n).
%C A145894 Mirror image of A145893.
%C A145894 Without the 0's, it is the triangle of A134434.
%C A145894 Sum of entries in row n = n! = A000142(n).
%C A145894 T(n,n) = A010551(n).
%C A145894 Lower diagonals give: A226282, A226283, A226284, A226285, A226286. - _Alois P. Heinz_, May 29 2014
%H A145894 Alois P. Heinz, <a href="/A145894/b145894.txt">Rows n = 0..140, flattened</a>
%F A145894 T(2n,2k) = [n!*C(n,k)]^2; T(2n+1,2k+1) = [(n+1)!*C(n,k)]^2/(k+1); elsewhere T(n,k)=0.
%e A145894 T(3,1) = 4 because we have 132, 312, 213 and 231.
%e A145894 Triangle starts:
%e A145894    1;
%e A145894    0,  1;
%e A145894    1,  0,   1;
%e A145894    0,  4,   0,  2;
%e A145894    4,  0,  16,  0,   4;
%e A145894    0, 36,   0, 72,   0, 12;
%e A145894   36,  0, 324,  0, 324,  0, 36;
%e A145894   ...
%p A145894 T:=proc(n,k) if `mod`(n, 2) = 0 and `mod`(k, 2) = 0 then factorial((1/2)*n)^2*binomial((1/2)*n, (1/2)*k)^2 elif `mod`(n, 2) = 1 and `mod`(k, 2) = 1 then 2*factorial((1/2)*n+1/2)^2*binomial((1/2)*n-1/2, (1/2)*k-1/2)^2/(k+1) else 0 end if end proc: for n from 0 to 10 do seq(T(n, k), k=0..n) end do; # yields sequence in triangular form
%t A145894 T[n_, k_] := Which[EvenQ[n] && EvenQ[k], (n/2)!^2*Binomial[n/2, k/2]^2, OddQ[n] && OddQ[k], (2*(n/2+1/2)!^2*Binomial[n/2-1/2, k/2-1/2]^2)/(k+1), True, 0]; Table[T[n, k], {n, 0, 10}, {k, 0, n}] // Flatten (* _Jean-François Alcover_, Feb 19 2017, translated from Maple *)
%Y A145894 Cf. A000142, A134434, A145893, A010551.
%K A145894 nonn,tabl
%O A145894 0,8
%A A145894 _Emeric Deutsch_, Nov 30 2008