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.

Showing 1-3 of 3 results.

A145893 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 opposite parities for k values of j (0<=k<=n).

Original entry on oeis.org

1, 1, 0, 1, 0, 1, 2, 0, 4, 0, 4, 0, 16, 0, 4, 12, 0, 72, 0, 36, 0, 36, 0, 324, 0, 324, 0, 36, 144, 0, 1728, 0, 2592, 0, 576, 0, 576, 0, 9216, 0, 20736, 0, 9216, 0, 576, 2880, 0, 57600, 0, 172800, 0, 115200, 0, 14400, 0, 14400, 0, 360000, 0, 1440000, 0, 1440000, 0, 360000, 0, 14400
Offset: 0

Views

Author

Emeric Deutsch, Nov 30 2008

Keywords

Comments

Mirror image of A145894.
Without the 0's it is the triangle of A145891.
Sum of entries in row n = n! = A000142(n).
Columns k=0,2,4,8,10,12 give: A010551, A226282, A226283, A226284, A226285, A226286. - Alois P. Heinz, May 29 2014

Examples

			T(3,2) = 4 because we have 132, 312, 213 and 231.
Triangle starts:
   1;
   1, 0;
   1, 0,   1;
   2, 0,   4, 0;
   4, 0,  16, 0,   4;
  12, 0,  72, 0,  36, 0;
  36, 0, 324, 0, 324, 0, 36;
  ...
		

Crossrefs

Programs

  • Maple
    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) = 0 then factorial((1/2)*n-1/2)*factorial((1/2)*n+1/2)*binomial((1/2)*n-1/2, (1/2)*k)*binomial((1/2)*n+1/2, (1/2)*k) 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
  • Mathematica
    T[n_, k_] := Which[EvenQ[n] && EvenQ[k], (n/2)!^2*Binomial[n/2, k/2]^2, OddQ[n] && EvenQ[k], (n/2-1/2)!*(n/2+1/2)!*Binomial[n/2-1/2, k/2] * Binomial[n/2+1/2, k/2], True, 0]; Table[T[n, k], {n, 0, 10}, {k, 0, n}] // Flatten (* Jean-François Alcover, Feb 20 2017, translated from Maple *)

Formula

T(2n,2k) = [n!*C(n,k)]^2; T(2n+1,2k) = n! (n+1)! C(n,k) C(n+1,k); elsewhere T(n,k)=0.

A226288 T(n,k) = [n/2]!*[(n+1)/2]!*C([n/2],k-1)*C([(n+1)/2],k-1).

Original entry on oeis.org

1, 0, 1, 0, 1, 2, 0, 0, 4, 4, 0, 0, 0, 16, 12, 0, 0, 0, 4, 72, 36, 0, 0, 0, 0, 36, 324, 144, 0, 0, 0, 0, 0, 324, 1728, 576, 0, 0, 0, 0, 0, 36, 2592, 9216, 2880, 0, 0, 0, 0, 0, 0, 576, 20736, 57600, 14400, 0, 0, 0, 0, 0, 0, 0, 9216, 172800, 360000, 86400, 0, 0, 0, 0, 0, 0, 0, 576, 115200, 1440000, 2592000, 518400
Offset: 1

Views

Author

R. H. Hardin, connection of formula with combinatoric problem via N. J. A. Sloane in the Sequence Fans Mailing List, Jun 02 2013

Keywords

Comments

T(n,k)=Number of permutations of n elements with 2k-2 odd displacements
Table starts:
.........1...........0............0............0............0............0
.........1...........1............0............0............0............0
.........2...........4............0............0............0............0
.........4..........16............4............0............0............0
........12..........72...........36............0............0............0
........36.........324..........324...........36............0............0
.......144........1728.........2592..........576............0............0
.......576........9216........20736.........9216..........576............0
......2880.......57600.......172800.......115200........14400............0
.....14400......360000......1440000......1440000.......360000........14400
.....86400.....2592000.....12960000.....17280000......6480000.......518400
....518400....18662400....116640000....207360000....116640000.....18662400
...3628800...152409600...1143072000...2540160000...1905120000....457228800
..25401600..1244678400..11202105600..31116960000..31116960000..11202105600
.203212800.11379916800.119489126400.398297088000.497871360000.238978252800

Crossrefs

Column 1 is A010551.
Columns 2-7 are: A226282-A226287.
Cf. A145891 (another version as irregular triangle)

Programs

  • Mathematica
    T[n_,k_]:=(Floor[n/2])!*(Floor[(n+1)/2])!*Binomial[Floor[n/2],k-1]*Binomial[Floor[(n+1)/2],k-1]; Table[Reverse[Table[T[n-k+1,k],{k,n}]],{n,12}]//Flatten (* Stefano Spezia, Jul 12 2024 *)

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).

Original entry on oeis.org

1, 1, 2, 6, 12, 12, 72, 48, 144, 432, 144, 1440, 2880, 720, 2880, 17280, 17280, 2880, 43200, 172800, 129600, 17280, 86400, 864000, 1728000, 864000, 86400, 1814400, 12096000, 18144000, 7257600, 604800, 3628800, 54432000, 181440000, 181440000, 54432000, 3628800
Offset: 0

Views

Author

Emeric Deutsch, Nov 30 2008

Keywords

Comments

Row n contains floor(n/2) entries (n>=2).
Sum of entries in row n = n! = A000142(n).
Sum_{k>=0} k*T(n,k) = A077612(n).
T(2n,k) = A134435(2n,k).

Examples

			T(4,1) = 12 because we have 1243, 1423, 1324, 1342, 3124, 3142, 2413, 4213, 2431, 4231, 3241 and 3421.
Triangle starts:
     1;
     1;
     2;
     6;
    12,   12;
    72,   48;
   144,  432, 144;
  1440, 2880, 720;
  ...
		

Crossrefs

Programs

  • Maple
    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
  • Mathematica
    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 *)

Formula

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).
Showing 1-3 of 3 results.