A231777
Number T(n,k) of permutations of [n] with exactly k ascents from odd to even numbers; triangle T(n,k), n>=0, 0<=k<=floor(n/2), read by rows.
Original entry on oeis.org
1, 1, 1, 1, 4, 2, 8, 14, 2, 54, 60, 6, 162, 402, 150, 6, 1536, 2712, 768, 24, 6144, 19704, 12744, 1704, 24, 75000, 183120, 94320, 10320, 120, 375000, 1473720, 1392720, 365520, 21720, 120, 5598720, 17522640, 13631040, 3011040, 152640, 720, 33592320, 156250800
Offset: 0
T(4,0) = 8: 1324, 2413, 2431, 3241, 4132, 4213, 4231, 4321.
T(4,1) = 14: 1243, 1342, 1423, 1432, 2134, 2143, 2314, 2341, 3124, 3142, 3214, 3421, 4123, 4312.
T(4,2) = 2: 1234, 3412.
T(5,2) = 6: 12345, 12534, 34125, 34512, 51234, 53412.
T(6,3) = 6: 123456, 125634, 341256, 345612, 561234, 563412.
Triangle T(n,k) begins:
: 0 : 1;
: 1 : 1;
: 2 : 1, 1;
: 3 : 4, 2;
: 4 : 8, 14, 2;
: 5 : 54, 60, 6;
: 6 : 162, 402, 150, 6;
: 7 : 1536, 2712, 768, 24;
: 8 : 6144, 19704, 12744, 1704, 24;
: 9 : 75000, 183120, 94320, 10320, 120;
: 10 : 375000, 1473720, 1392720, 365520, 21720, 120;
Row sums and T(2n,n) give:
A000142.
T(n,floor(n/2)) gives:
A081123(n+1).
A359039
Number of Wachs permutations of size n.
Original entry on oeis.org
1, 1, 2, 4, 8, 24, 48, 192, 384, 1920, 3840, 23040, 46080, 322560, 645120, 5160960, 10321920, 92897280, 185794560, 1857945600, 3715891200, 40874803200, 81749606400, 980995276800, 1961990553600, 25505877196800, 51011754393600, 714164561510400, 1428329123020800
Offset: 0
For n=4, a(n)=8, since we have the 8 Wachs permutations 1234, 1243, 2134, 2143, 3412, 3421, 4312, 4321.
-
A359039 := proc(n)
local m ;
m := floor(n/2) ;
if type(n,'even') then
m!*2^m ;
else
(m+1)!*2^m ;
end if;
end proc: # R. J. Mathar, Jul 17 2023
# second Maple program:
a:= n-> ceil(n/2)!*2^floor(n/2):
seq(a(n), n=0..28); # Alois P. Heinz, Dec 21 2023
-
a[n_]:=If[EvenQ[n], (n/2)! 2^(n/2), ((n + 1)/2)!*2^((n - 1)/2)]
A366109
a(n) = floor(n!*(3*floor(n/2)!*ceiling(n/2)! + 3*floor((n+2)/2)!*ceiling((n-2)/2)! - 6*floor(n/2)!*ceiling((n-2)/2)!)^(-1)).
Original entry on oeis.org
1, 1, 2, 4, 7, 13, 26, 46, 92, 168, 333, 616, 1225, 2288, 4558, 8580, 17107, 32413, 64664, 123170, 245832, 470288, 938943, 1802770, 3600207, 6933733, 13849778, 26744400, 53429368, 103411680, 206621384, 400720260, 800747232, 1555737480, 3109074130, 6050090200, 12091800773
Offset: 3
A133922
a(n) is number of permutations (p(1),p(2),p(3),...,p(n)) of (1,2,3,...,n) such that p(k) is coprime to p(n+1-k) for k = all positive integers <= n.
Original entry on oeis.org
1, 2, 2, 16, 16, 192, 192, 6912, 4608, 230400, 230400, 11612160, 11612160, 1199923200, 588349440, 98594979840, 98594979840, 11076328488960, 11076328488960, 2102897147904000, 1076597725593600, 331238941183180800, 331238941183180800, 66325953940291584000, 56326771107377971200
Offset: 1
For n = 6, the permutation (3,2,1,6,4,5) is not counted because p(2)=2 is not coprime to p(5)=4. However, the permutation (3,6,1,4,5,2) is counted because GCD(3,2) = GCD(6,5) = GCD(1,4) = 1.
-
M:= proc(A) option remember;
local n,t,i,Ai,Ap,inds,isrt,As;
n:= nops(A);
if n = 0 then return 1 fi;
t:= 0;
for i in A[1] do
inds:= [$2..i-1,$i+1..n];
Ai:= subs([1=NULL,i=NULL,seq(inds[i]=i,i=1..n-2)],A[inds]);
isrt:= sort([$1..n-2],(r,s) -> nops(Ai(r)) <= nops(Ai(s)),output=permutation);
Ai:= subs([seq(isrt[i]=i,i=1..n-2)],Ai[isrt]);
t:= t + procname(Ai);
od;
t;
end proc:
F:= proc(n) local A;
if n::odd then
if isprime(n) then return procname(n-1) fi;
A:= [seq(select(t -> igcd(t+1,i+1)=1, [$1..i-1,$i+1..n-1]),i=1..n-1)];
else
A:= [seq(select(t -> igcd(t,i)=1,[$1..i-1,$i+1..n]),i=1..n)]
fi;
M(A)*floor(n/2)!*2^floor(n/2)
end proc;
seq(F(n),n=1..27); # Robert Israel, Sep 12 2016
A249138
Triangular array read by rows: row n gives the coefficients of the polynomial p(n,x) defined in Comments.
Original entry on oeis.org
1, 1, 1, 2, 1, 1, 2, 4, 1, 1, 6, 5, 7, 1, 1, 6, 18, 8, 10, 1, 1, 24, 26, 46, 12, 14, 1, 1, 24, 96, 58, 86, 16, 18, 1, 1, 120, 154, 326, 118, 156, 21, 23, 1, 1, 120, 600, 444, 756, 198, 246, 26, 28, 1, 1, 720, 1044, 2556, 1152, 1692, 324, 384, 32, 34, 1, 1
Offset: 0
f(0,x) = 1/1, so that p(0,x) = 1;
f(1,x) = (1 + x)/1, so that p(1,x) = 1 + x;
f(2,x) = (2 + x + x^2)/(1 + x), so that p(2,x) = 2 + x + x^2.
First 6 rows of the triangle of coefficients:
1
1 1
2 1 1
2 4 1 1
6 5 7 1 1
6 18 8 10 1 1
-
z = 15; p[x_, n_] := x + Floor[(n+1)/2]/p[x, n - 1]; p[x_, 1] = 1;
t = Table[Factor[p[x, n]], {n, 1, z}]
u = Numerator[t]
TableForm[Table[CoefficientList[u[[n]], x], {n, 1, z}]] (* A249138 array *)
Flatten[CoefficientList[u, x]] (* A249138 sequence *)
A355986
a(n) = Sum_{k=1..n} floor(n/k)!.
Original entry on oeis.org
1, 3, 8, 28, 125, 731, 5052, 40352, 362917, 3628935, 39916936, 479002360, 6227021561, 87178296283, 1307674373184, 20922789928484, 355687428136485, 6402373706091651, 121645100409195652, 2432902008180269688, 51090942171713074013, 1124000727777647602015
Offset: 1
a(6) = 6! + 3! + 2! + 1! + 1! + 1! = 731.
-
a[n_] := Sum[Floor[n/k]!, {k, 1, n}]; Array[a, 22] (* Amiram Eldar, Jul 22 2022 *)
-
a(n) = sum(k=1, n, (n\k)!);
A361522
The aerated factorial numbers.
Original entry on oeis.org
1, 0, 1, 0, 2, 0, 6, 0, 24, 0, 120, 0, 720, 0, 5040, 0, 40320, 0, 362880, 0, 3628800, 0, 39916800, 0, 479001600, 0, 6227020800, 0, 87178291200, 0, 1307674368000, 0, 20922789888000, 0, 355687428096000, 0, 6402373705728000, 0, 121645100408832000, 0, 2432902008176640000
Offset: 0
-
egf := (z/2)*Pi^(1/2)*erf(z/2)*exp((z/2)^2) + 1:
ser := series(egf, z, 42): seq(n!*coeff(ser, z, n), n = 0..40);
-
a[n_] := If[OddQ[n], 0, (n/2)!]; Array[a, 41, 0] (* Amiram Eldar, Mar 14 2023 *)
A373829
Number of inefficient arrangements in A373182, where inefficient means that the maximum number of persons that a seating arrangement can hold is not achieved.
Original entry on oeis.org
0, 0, 1, 0, 6, 2, 36, 24, 246, 240, 1920, 2424, 16920, 25920, 166440, 297360, 1809360, 3669840, 21551040, 48666240, 279180720, 691649280, 3908580480, 10501787520, 58813776000, 169809696000, 946627274880, 2914924320000, 16228733875200, 52963370208000
Offset: 1
a(5)=6 are the following seatings, where _ denotes an empty seat. Seatings of 3 people are the maximum for n=5 and those are not included.
1 _ _ 2 _
_ 1 _ 2 _
_ 1 _ _ 2
_ 2 _ 1 _
2 _ _ 1 _
_ 2 _ _ 1.
For n=9 seats the maximum number of persons that can be seated is 5, hence examples of inefficient arrangements are:
3 _ 2 _ 1 _ _ 4 _
_ 3 _ _ 1 _ _ 2 _.
Comments