A077611
Number of adjacent pairs of form (odd,odd) among all permutations of {1,2,...,n}.
Original entry on oeis.org
0, 0, 4, 12, 144, 720, 8640, 60480, 806400, 7257600, 108864000, 1197504000, 20118067200, 261534873600, 4881984307200, 73229764608000, 1506440871936000, 25609494822912000, 576213633515520000, 10948059036794880000, 267619220899430400000, 5620003638888038400000
Offset: 1
For n=4, the a(4) = 12 permutations of degree 5 starting and ending with an even number are 21354, 21534, 23154, 23514, 25134, 25314, 41352, 41532, 43152, 43512, 45132, 45312.
-
[Factorial(n-1)*(2*n*(n-1)-(2*n-1)*(-1)^n-1)/8 : n in [1..30]]; // Vincenzo Librandi, Nov 16 2011
-
Table[Ceiling[n/2] Ceiling[n/2 - 1] (n - 1)!, {n, 22}] (* Michael De Vlieger, Aug 20 2017 *)
A152874
Triangle read by rows: T(n,k) is the number of permutations of {1,2,...,n} with k parity changes (n>=2; 1<=k <=n-1); the permutation 372185946 has 5 parity changes: 37-2-1-8-59-46.
Original entry on oeis.org
2, 4, 2, 8, 8, 8, 24, 36, 48, 12, 72, 144, 288, 144, 72, 288, 720, 1728, 1296, 864, 144, 1152, 3456, 10368, 10368, 10368, 3456, 1152, 5760, 20160, 69120, 86400, 103680, 51840, 23040, 2880, 28800, 115200, 460800, 691200, 1036800, 691200, 460800, 115200, 28800
Offset: 2
T(4,3) = 8 because we have 1243, 1423, 4132, 4312, 2134, 2314, 3241 and 3421.
Triangle starts:
2;
4, 2;
8, 8, 8;
24, 36, 48, 12;
72, 144, 288, 144, 72;
...
-
ae := proc (n, k) if `mod`(k, 2) = 0 then 2*factorial(n)^2*binomial(n-1, (1/2)*k-1)*binomial(n-1, (1/2)*k) else 2*factorial(n)^2*binomial(n-1, (1/2)*k-1/2)^2 end if end proc: ao := proc (n, k) if `mod`(k, 2) = 0 then factorial(n)*factorial(n+1)*(binomial(n, (1/2)*k)*binomial(n-1, (1/2)*k-1)+binomial(n, (1/2)*k-1)*binomial(n-1, (1/2)*k)) else 2*factorial(n)*factorial(n+1)*binomial(n, (1/2)*k-1/2)*binomial(n-1, (1/2)*k-1/2) end if 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 from 2 to 10 do seq(T(n, k), k = 1 .. n-1) end do; # yields sequence in triangular form
# second Maple program:
b:= proc(x, y, t) option remember; `if`(x+y=0, 1, `if`(x>0,
b(x-1, y, z)*x, 0)+`if`(y>0, expand(b(y-1, x, z)*y*t), 0))
end:
T:= n-> (h-> (p-> seq(coeff(p, z, i), i=1..n-1))(b(h, n-h, 1)))(iquo(n, 2)):
seq(T(n), n=2..12); # Alois P. Heinz, May 23 2023
-
b[x_, y_, t_] := b[x, y, t] = If[x + y == 0, 1, If[x > 0, b[x - 1, y, z]*x, 0] + If[y > 0, Expand[b[y - 1, x, z]*y*t], 0]];
T[n_] := Table[Coefficient[#, z, i], {i, 1, n-1}]&[b[#, n-#, 1]]&[ Quotient[n, 2]];
Table[T[n], {n, 2, 12}] // Flatten (* Jean-François Alcover, Aug 16 2023, after Alois P. Heinz *)
A077612
Number of adjacent pairs of form (even,even) among all permutations of {1,2,...,n}.
Original entry on oeis.org
0, 0, 0, 12, 48, 720, 4320, 60480, 483840, 7257600, 72576000, 1197504000, 14370048000, 261534873600, 3661488230400, 73229764608000, 1171676233728000, 25609494822912000, 460970906812416000, 10948059036794880000, 218961180735897600000, 5620003638888038400000
Offset: 1
-
a[n_] := Floor[n/2]*Floor[n/2 - 1]*(n - 1)!; Array[a, 25] (* Amiram Eldar, Jan 22 2023 *)
-
a(n) = n\2 * (n\2-1)*(n-1)! ; \\ Michel Marcus, Aug 29 2013
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)).
Original entry on oeis.org
1, 1, 1, 1, 2, 4, 4, 16, 4, 12, 72, 36, 36, 324, 324, 36, 144, 1728, 2592, 576, 576, 9216, 20736, 9216, 576, 2880, 57600, 172800, 115200, 14400, 14400, 360000, 1440000, 1440000, 360000, 14400, 86400, 2592000, 12960000, 17280000, 6480000, 518400
Offset: 0
T(3,1) = 4 because we have 123, 132, 312 and 321.
Triangle starts:
1;
1;
1, 1;
2, 4;
4, 16, 4;
12, 72, 36;
36, 324, 324, 36;
...
-
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[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 *)
A363496
Total number of parity changes within the blocks of all partitions of [n].
Original entry on oeis.org
0, 0, 1, 4, 17, 74, 356, 1808, 9923, 57442, 354407, 2296028, 15704028, 112266048, 841442105, 6564854864, 53413489773, 450789496454, 3950844987040, 35809477617544, 335901221506491, 3250110998386534, 32453151223493139, 333520967584364248, 3528754456836294712
Offset: 0
a(4) = 17 = 6*1 + 4*2 + 1*3: 124|3, 12|3|4, 134|2, 1|23|4, 14|2|3, 1|2|34, 123|4, 12|34, 14|23, 1|234, 1234.
-
b:= proc(n, x, y) option remember; `if`(n=0, [1, 0],
`if`(y=0, 0, (p-> p+[0, p[1]])(b(n-1, y-1, x+1)*y))+
b(n-1, y, x)*x + b(n-1, y, x+1))
end:
a:= n-> b(n, 0$2)[2]:
seq(a(n), n=0..24);
A060408
Triangle T(n,k) in which n-th row gives numbers of super edge-magic labelings of (n,k)-graphs, for n >= 2, and 1 <= k <= 2n-3.
Original entry on oeis.org
1, 3, 2, 1, 6, 6, 6, 4, 2, 10, 14, 20, 24, 24, 16, 8, 15, 26, 48, 80, 120, 144, 144, 96, 48, 21, 44, 99, 212, 420, 720, 1080, 1296, 1296, 864, 432, 28, 68, 180, 464, 1140, 2520, 5040, 8640, 12960, 15552, 15552, 10368, 5184
Offset: 2
1; 3,2,1; 6,6,6,4,2; 10,14,20,24,24,16,8; ...
-
A060408 := func< n, k | &+[ Integers() | &*[ Integers() | a[j] : j in [i .. i+k-1] ] : i in [3 .. 2*n-k] ] where a is [ j lt 3 select 0 else j le n+1 select (j-1) div 2 else (2*n-j+1) div 2 : j in [1..2*n-1] ] >; [[ A060408(n,k): k in [1..2*n-3] ]: n in [1..10]];
Entry T(3,3)=1 (that was erroneously missing from the table of Figueroa-Centeno et al. making the rows appear to be irregular) inserted by, DOI reference provided by, and empirical cross reference for the T(n,n) diagonal observed by
Jason Kimberley, Apr 16 2010
A306258
a(n) = floor(n^2/4)*n!.
Original entry on oeis.org
0, 0, 2, 12, 96, 720, 6480, 60480, 645120, 7257600, 90720000, 1197504000, 17244057600, 261534873600, 4271736268800, 73229764608000, 1339058552832000, 25609494822912000, 518592270163968000, 10948059036794880000, 243290200817664000000
Offset: 0
-
Table[Floor[n^2/4]n!,{n,0,40}] (* Harvey P. Dale, Jan 16 2023 *)
-
a(n) = floor(n^2/4)*n!;
A152661
Number of permutations of [n] for which the first two entries have the same parity (n>=2).
Original entry on oeis.org
0, 2, 8, 48, 288, 2160, 17280, 161280, 1612800, 18144000, 217728000, 2874009600, 40236134400, 610248038400, 9763968614400, 167382319104000, 3012881743872000, 57621363351552000, 1152427267031040000, 24329020081766400000, 535238441798860800000
Offset: 2
a(4)=8 because we have 1324, 1342, 3124, 3142, 2413, 2431, 4213 and 4231.
-
a := proc (n) if `mod`(n, 2) = 0 then 2*factorial((1/2)*n)^2*binomial(n-2, (1/2)*n) else factorial((1/2)*n-1/2)*factorial((1/2)*n+1/2)*binomial(n-1, (1/2)*n-3/2) end if end proc: seq(a(n), n = 2 .. 22);
-
a[n0_?EvenQ] := With[{n = n0/2}, 2 (n!)^2*Binomial[2*n - 2, n]];
a[n1_?OddQ] := With[{n = (n1 - 1)/2}, n! (n + 1)! Binomial[2 n, n - 1]];
Table[a[n], {n, 2, 22}] (* Jean-François Alcover, Nov 28 2017 *)
Showing 1-8 of 8 results.
Comments