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 A152666 #11 Aug 12 2019 23:14:46 %S A152666 1,2,4,2,12,12,36,72,12,144,432,144,576,2592,1728,144,2880,17280, %T A152666 17280,2880,14400,115200,172800,57600,2880,86400,864000,1728000, %U A152666 864000,86400,518400,6480000,17280000,12960000,2592000,86400,3628800,54432000 %N A152666 Triangle read by rows: T(n,k) is the number of permutations of {1,2,...,n} having k runs of odd entries (1<=k<=ceiling(n/2)). For example, the permutation 321756498 has 3 runs of odd entries: 3, 175 and 9. %C A152666 Sum of entries in row n is n! (=A000142(n)). %C A152666 Row n contains ceiling(n/2) entries. %C A152666 T(n,1) = A010551(n+1). %C A152666 Sum_{k>=1} k*T(n,k) = A052618(n-1). %C A152666 Mirror image of A134435. %F A152666 T(2n,k) = (n!)^2*binomial(n+1,k)*binomial(n-1,k-1). %F A152666 T(2n+1,k) = n!*(n+1)!*binomial(n,k-1)*binomial(n+1,k). %e A152666 T(3,2)=2 because we have 123 and 321. %e A152666 T(4,2)=12 because we have 1234, 1432, 3214, 3412, 1243, 3241 and their reverses. %e A152666 Triangle starts: %e A152666 1; %e A152666 2; %e A152666 4,2; %e A152666 12,12; %e A152666 36,72,12; %e A152666 144,432,144; %e A152666 576,2592,1728,144. %p A152666 ae := proc (n, k) options operator, arrow: factorial(n)^2*binomial(n+1, k)*binomial(n-1, k-1) end proc: ao := proc (n, k) options operator, arrow: factorial(n)*factorial(n+1)*binomial(n, k-1)*binomial(n+1, k) end proc: T := proc (n, k) if `mod`(n, 2) = 0 then ae((1/2)*n, k) else ao((1/2)*n-1/2, k) end if end proc: for n to 12 do seq(T(n, k), k = 1 .. ceil((1/2)*n)) end do; # yields sequence in triangular form %t A152666 T[n_?EvenQ, k_] := (n/2)!^2*Binomial[n/2 - 1, k - 1]*Binomial[n/2 + 1, k]; T[n_?OddQ, k_] := ((n - 1)/2 + 1)!*((n - 1)/2)!*Binomial[(n - 1)/2 + 1, k]*Binomial[(n - 1)/2, k - 1]; Table[T[n, k], {n, 1, 12}, {k, 1, Floor[(n + 1)/2]}] // Flatten (* _Jean-François Alcover_, Nov 13 2016 *) %Y A152666 Cf. A000142, A010551, A052618, A152667, A134435. %K A152666 nonn,tabf %O A152666 1,2 %A A152666 _Emeric Deutsch_, Dec 14 2008