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.
%I A145891 #13 Jul 12 2024 16:00:17 %S A145891 1,1,1,1,2,4,4,16,4,12,72,36,36,324,324,36,144,1728,2592,576,576,9216, %T A145891 20736,9216,576,2880,57600,172800,115200,14400,14400,360000,1440000, %U A145891 1440000,360000,14400,86400,2592000,12960000,17280000,6480000,518400 %N A145891 Triangle read by rows: T(n,k) is the number of permutations of {1,2,...,n} having k adjacent pairs of the form (odd,even) (0<=k<=floor(n/2)). %C A145891 Also number of permutations of {1,2,...,n} having k adjacent pairs of the form (even,odd). Example: T(3,1) = 4 because we have 123, 213, 231 and 321. %C A145891 Row n contains 1+floor(n/2) entries. %C A145891 Mirror image of A134434. %C A145891 Sum of entries in row n = n! = A000142(n). %C A145891 Sum_{k>=0} k*T(n,k) = A077613(n). %F A145891 T(2n,k) = [n!*C(n,k)]^2; T(2n+1,k) = n!*(n+1)!*C(n,k)*C(n+1,k). %e A145891 T(3,1) = 4 because we have 123, 132, 312 and 321. %e A145891 Triangle starts: %e A145891 1; %e A145891 1; %e A145891 1, 1; %e A145891 2, 4; %e A145891 4, 16, 4; %e A145891 12, 72, 36; %e A145891 36, 324, 324, 36; %e A145891 ... %p A145891 T:=proc(n,k) if `mod`(n, 2) = 0 then factorial((1/2)*n)^2*binomial((1/2)*n, k)^2 else factorial((1/2)*n-1/2)*factorial((1/2)*n+1/2)*binomial((1/2)*n-1/2, k)*binomial((1/2)*n+1/2, k) end if end proc: for n from 0 to 11 do seq(T(n,k), k =0..floor((1/2)*n)) end do; # yields sequence in triangular form %t A145891 T[n_,k_]:=If[EvenQ[n],Floor[(n/2)!Binomial[n/2,k]]^2, ((n-1)/2)!((n+1)/2)!Binomial[(n-1)/2,k]Binomial[(n+1)/2,k]]; Table[T[n,k],{n,0,11},{k,0,Floor[n/2]}]//Flatten (* _Stefano Spezia_, Jul 12 2024 *) %Y A145891 Cf. A000142, A077613, A134434, A134435, A145892. %K A145891 nonn,tabf %O A145891 0,5 %A A145891 _Emeric Deutsch_, Nov 30 2008