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.

A145892 Triangle read by rows: T(n,k) is the number of permutations of {1,2,...,n} having k adjacent pairs of the form (even,even) (0<=k<=floor(n/2)-1).

This page as a plain text file.
%I A145892 #9 Jul 12 2024 16:30:50
%S A145892 1,1,2,6,12,12,72,48,144,432,144,1440,2880,720,2880,17280,17280,2880,
%T A145892 43200,172800,129600,17280,86400,864000,1728000,864000,86400,1814400,
%U A145892 12096000,18144000,7257600,604800,3628800,54432000,181440000,181440000,54432000,3628800
%N A145892 Triangle read by rows: T(n,k) is the number of permutations of {1,2,...,n} having k adjacent pairs of the form (even,even) (0<=k<=floor(n/2)-1).
%C A145892 Row n contains floor(n/2) entries (n>=2).
%C A145892 Sum of entries in row n = n! = A000142(n).
%C A145892 Sum_{k>=0} k*T(n,k) = A077612(n).
%C A145892 T(2n,k) = A134435(2n,k).
%F A145892 T(2n,k) = (n!)^2*C(n-1,k)*C(n+1,k+1); T(2n+1,k) = n!(n+1)! * C(n-1,k) * C(n+2,k+2).
%e A145892 T(4,1) = 12 because we have 1243, 1423, 1324, 1342, 3124, 3142, 2413, 4213, 2431, 4231, 3241 and 3421.
%e A145892 Triangle starts:
%e A145892      1;
%e A145892      1;
%e A145892      2;
%e A145892      6;
%e A145892     12,   12;
%e A145892     72,   48;
%e A145892    144,  432, 144;
%e A145892   1440, 2880, 720;
%e A145892   ...
%p A145892 T:=proc(n,k) if `mod`(n, 2) = 0 then factorial((1/2)*n)^2*binomial((1/2)*n-1, k)*binomial((1/2)*n+1, k+1) else factorial((1/2)*n-1/2)*factorial((1/2)*n+1/2)*binomial((1/2)*n-3/2, k)*binomial((1/2)* n+3/2, k+2) end if end proc: 1; 1; for n from 2 to 12 do seq(T(n, k), k = 0 .. floor((1/2)*n)-1) end do; # yields sequence in triangular form
%t A145892 T[n_,k_]:=If[EvenQ[n],((n/2)!)^2Binomial[n/2-1,k]Binomial[n/2+1,k+1], ((n-1)/2)!((n+1)/2)!Binomial[(n-3)/2,k]Binomial[(n+3)/2,k+2]]; Join[{1,1},Flatten[Table[T[n,k],{n,0,12},{k,0,Floor[n/2]-1}]]] (* _Stefano Spezia_, Jul 12 2024 *)
%Y A145892 Cf. A000142, A077612, A134434, A134435, A145891.
%K A145892 nonn,tabf
%O A145892 0,3
%A A145892 _Emeric Deutsch_, Nov 30 2008