A345697
Expansion of the e.g.f. sqrt(1 / (2*exp(x) - 2*x*exp(x) - 1)).
Original entry on oeis.org
1, 0, 1, 2, 12, 64, 485, 4038, 39991, 441992, 5492322, 75171700, 1127989577, 18381446004, 323527186957, 6114296752718, 123513004310640, 2655648779976640, 60554669008300565, 1459559515622280282, 37079264125376670955, 990226180225789628660, 27733277682719819190246, 812818183963966524137332, 24880254143735238825011057
Offset: 0
sqrt(1/(2*exp(x)-2*x*exp(x)-1)) = 1 + x^2/2! + 2*x^3/3! + 12*x^4/4! + 64*x^5/5! + 485*x^6/6! + 4038*x^7/7! + 39991*x^8/8! + 441992*x^9/9! + ...
a(13) = Sum_{k=1..6} A014307(k)*A008306(13,k) = 18381446004.
A014307(1)*A008306(13,1) == -1 (mod 13), because A014307(1) = 1 and A008306(13,1) = (13-1)!
For k>=2, A008306(13,k) == 0 (mod 13), result a(13) == -1 (mod 13).
-
A014307 := proc(n) option remember; `if`(n=0, 1 , 1+add((-1+binomial(n, k))*A014307(k), k=1..n-1)) end:
A008306 := proc(n, k): if k=1 then (n-1)! ; elif n<=2*k-1 then 0; else (n-1)*procname(n-1, k)+(n-1)*procname(n-2, k-1) ; end if; end proc:
a := n-> add((A014307(k)*A008306(n,k)), k=1..floor(n/2)):a(0):=1 ;
seq(a(n), n=0..24);
# second program:
a := series(sqrt((1/(2*exp(x)-2*x*exp(x)-1))), x=0, 25):
seq(n!*coeff(a, x, n), n=0..24);
-
CoefficientList[Series[Sqrt[1/(2*E^x-2*x*E^x-1)], {x, 0, 24}], x] * Range[0, 24]!
-
my(x='x+O('x^25)); Vec(serlaplace(sqrt(1 / (2*exp(x) - 2*x*exp(x) -1)))) \\ Michel Marcus, Jun 24 2021
A345969
Expansion of the e.g.f. 1 / sqrt(3 - 2 / ((1 - x)*exp(x))).
Original entry on oeis.org
1, 0, 1, 2, 18, 104, 1015, 9666, 116557, 1504856, 22300704, 358916480, 6373675825, 122332173300, 2540560235161, 56558354414870, 1346402030278050, 34093192112537888, 915570658175517151, 25983157665663651150, 777141557158947654637, 24430880483991543481580
Offset: 0
1/sqrt(3-2/((1-x)*exp(x))) = 1 + x^2/2! + 2*x^3/3! + 18*x^4/4! + 104*x^5/5! + 1015*x^6/6! + 9666*x^7/7! + 116557*x^8/8! + 1504856*x^9/9! + ...
a(17) = Sum_{k=1..8} A305404(k)*A008306(17,k) = 34093192112537888.
For k=1, A305404(1)*A008306(17,1) == -1 (mod 17), because A305404(1) = 1 and A008306(17,1) = (17-1)!
For k>=2, A305404(k)*A008306(17,k) == 0 (mod 17), because A008306(17,k) == 0 (mod 17), result a(17) == -1 (mod 17).
-
A305404:= n-> add(Stirling2(n,k)*doublefactorial(2*k-1), k=0..n):
A008306 := proc(n, k): if k=1 then (n-1)! ; elif n<=2*k-1 then 0; else (n-1)*procname(n-1, k)+(n-1)*procname(n-2, k-1) ; end if; end proc:
a := n-> add((A305404(k)*A008306(n, k)), k=1..iquo(n,2)):a(0):=1 ; seq(a(n), n=0..24);
# second program:
a := series(1/sqrt(3-2/((1-x)*exp(x))), x=0, 25):seq(n!*coeff(a, x, n), n=0..24);
-
CoefficientList[Series[1/Sqrt[3-2/((1-x)*E^x)], {x, 0, 24}], x] * Range[0, 24]!
-
my(x='x+O('x^30)); Vec(serlaplace(1/sqrt(3 - 2 / ((1 - x)*exp(x))))) \\ Michel Marcus, Jul 01 2021
A050211
Triangle of number of permutations of {1, 2, ..., n} having exactly k cycles, each of which is of length >=r for r=3.
Original entry on oeis.org
2, 6, 24, 120, 40, 720, 420, 5040, 3948, 40320, 38304, 2240, 362880, 396576, 50400, 3628800, 4419360, 859320, 39916800, 53048160, 13665960, 246400, 479001600, 684478080, 216339552, 9609600, 6227020800, 9464307840, 3501834336
Offset: 3
Table begins:
n\k | u u^2 u^3
= = = = = = = = = = = = = = =
3 | 2
4 | 6
5 | 24
6 | 120 40
7 | 720 420
8 | 5040 3948
9 | 40320 38304 2240
...
- L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 257.
- Alois P. Heinz, Rows n = 3..200, flattened
- S. Brassesco, M. A. Méndez, The asymptotic expansion for the factorial and Lagrange inversion formula, arXiv:1002.3894v1 [math.CA], 2010.
- G. Nemes, On the Coefficients of the Asymptotic Expansion of n!, J. Int. Seq. 13 (2010), 10.6.6.
- Eric Weisstein's World of Mathematics, Permutation Cycle.
-
b:= proc(n) option remember; expand(`if`(n=0, 1, add(
b(n-i)*x*binomial(n-1, i-1)*(i-1)!, i=3..n)))
end:
T:= n-> (p-> seq(coeff(p, x, i), i=1..degree(p)))(b(n)):
seq(T(n), n=3..15); # Alois P. Heinz, Sep 25 2016
-
t[n_ /; n >= 3, k_ /; k >= 1] := t[n, k] = (n - 1)*t[n - 1, k] + (n - 2)*(n - 1)*t[n - 3, k - 1] ; t[, ] = 0; t[3, 1] = 2; Flatten[ Table[t[n, k], {n, 3, 15}, {k, 1, Floor[n/3]}]] (* Jean-François Alcover, Nov 05 2012, after Peter Bala *)
A050212
Triangle of number of permutations of {1, 2, ..., n} having exactly k cycles, each of which is of length >=r for r=4.
Original entry on oeis.org
6, 24, 120, 720, 5040, 1260, 40320, 18144, 362880, 223776, 3628800, 2756160, 39916800, 35307360, 1247400, 479001600, 476910720, 38918880, 6227020800, 6822541440, 889945056, 87178291200, 103440879360, 18478684224
Offset: 4
Triangle begins:
: 6;
: 24;
: 120;
: 720;
: 5040, 1260;
: 40320, 18144;
: 362880, 223776;
: 3628800, 2756160;
: 39916800, 35307360, 1247400;
- L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 257.
-
b:= proc(n) option remember; expand(`if`(n=0, 1, add(
b(n-i)*x*binomial(n-1, i-1)*(i-1)!, i=4..n)))
end:
T:= n-> (p-> seq(coeff(p, x, i), i=1..degree(p)))(b(n)):
seq(T(n), n=4..20); # Alois P. Heinz, Sep 25 2016
-
b[n_] := b[n] = Expand[If[n==0, 1, Sum[b[n-i] x Binomial[n-1, i-1] (i-1)!, {i, 4, n}]]];
T[n_] := Function[p, Table[Coefficient[p, x, i], {i, Exponent[p, x]}]][b[n]];
Table[T[n], {n, 4, 20}] // Flatten (* Jean-François Alcover, Dec 07 2019, after Alois P. Heinz *)
A050213
Triangle of number of permutations of {1, 2, ..., n} having exactly k cycles, each of which is of length >=r for r=5.
Original entry on oeis.org
24, 120, 720, 5040, 40320, 362880, 72576, 3628800, 1330560, 39916800, 20338560, 479001600, 303937920, 6227020800, 4643084160, 87178291200, 73721007360, 1743565824, 1307674368000, 1224694598400, 69742632960, 20922789888000
Offset: 5
Triangle begins:
05: 24;
06: 120;
07: 720;
08: 5040;
09: 40320;
10: 362880, 72576;
11: 3628800, 1330560;
12: 39916800, 20338560;
- L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 257.
-
b:= proc(n) option remember; expand(`if`(n=0, 1, add(
b(n-i)*x*binomial(n-1, i-1)*(i-1)!, i=5..n)))
end:
T:= n-> (p-> seq(coeff(p, x, i), i=1..degree(p)))(b(n)):
seq(T(n), n=5..20); # Alois P. Heinz, Sep 25 2016
-
b[n_] := b[n] = Expand[If[n == 0, 1, Sum[b[n - i]*x*Binomial[n - 1, i - 1]* (i - 1)!, {i, 5, n}]]];
T[n_] := Function[p, Table[Coefficient[p, x, i], {i, 1, Exponent[p, x]}]][ b[n]];
T /@ Range[5, 20] // Flatten (* Jean-François Alcover, Dec 08 2019, after Alois P. Heinz *)
A079510
Triangle T(n,k) read by rows; related to number of preorders.
Original entry on oeis.org
1, 0, 2, 0, 3, 6, 0, 0, 20, 24, 0, 0, 15, 130, 120, 0, 0, 0, 210, 924, 720, 0, 0, 0, 105, 2380, 7308, 5040, 0, 0, 0, 0, 2520, 26432, 64224, 40320, 0, 0, 0, 0, 945, 44100, 303660, 623376, 362880, 0, 0, 0, 0, 0, 34650, 705320, 3678840, 6636960, 3628800
Offset: 1
Triangle begins:
1;
0, 2;
0, 3, 6;
0, 0, 20, 24;
0, 0, 15, 130, 120;
...
-
T[n_, k_]:= If[k < 1 || k > n, 0, If[n==1 && k==1, 1, n*(T[n-1, k-1] + T[n-2, k-1])]]; Table[T[n, k], {n, 1, 10}, {k, 1, n}]//Flatten (* G. C. Greubel, Jan 17 2019 *)
-
T(n,k)=if(k<=0 || k>n, 0, if(n==1 && k==1, 1, n*(T(n-1,k-1)+T(n-2,k-1))));
A346119
Expansion of the e.g.f. sqrt(2*x*exp(x) - 2*exp(x) + 3).
Original entry on oeis.org
1, 0, 1, 2, 0, -16, -35, 342, 2779, -6424, -239382, -822460, 22393657, 278844084, -1553468891, -68399947042, -275025888900, 15302175612416, 243541868882077, -2463105309082902, -121649966081262521, -473088821582805820, 50905612811064360006, 945133249101683013812, -15321255878414345388335
Offset: 0
sqrt(2*x*exp(x)-2*exp(x)+3) = 1 + x^2/2! + 2*x^3/3! - 16*x^5/5! - 35*x^6/6! + 342*x^7/7! + 2779*x^8/8! - 6424*x^9/9! + ...
a(11) = Sum_{k=1..5} (-1)^(k-1)*A006677(k)*A008306(11,k) = -822460.
For k=1, (-1)^(1-1)*A006677(1)*A008306(11,1) == -1 (mod 11), because A006677(1) = 1 and A008306(11,1) = (11-1)!
For k>=2, (-1)^(k-1)*A006677(k)*A008306(11,k) == 0 (mod 11), because A008306(11,k) == 0 (mod 11), result a(11) == -1 (mod 11).
a(8) = Sum_{k=1..4} (-1)^(k-1)*A006677(k)*A008306(8,k) = 2779.
a(8) == 0 (mod (8-1)), because for k >= 1, A008306(8,k) == 0 (mod 7).
-
stirtr:= proc(p) proc(n) add(p(k)*Stirling2(n, k), k=0..n) end end: f:= n-> `if`(n=0, 1, (2*n-2)!/ (n-1)!/ 2^(n-1)): A006677:= stirtr(f): # Alois P. Heinz, 2008.
A008306 := proc(n, k): if k=1 then (n-1)! ; elif n<=2*k-1 then 0; else (n-1)*procname(n-1, k)+(n-1)*procname(n-2, k-1) ; end if; end proc:
a:= n-> add(((-1)^(k-1)*A006677(k)*A008306(n,k)), k=1..iquo(n,2)):a(0):=1 ; seq(a(n), n=0..24);
# second program:
a := series(sqrt(2*x*exp(x)-2*exp(x)+3), x=0, 25):seq(n!*coeff(a, x, n), n=0..24);
-
CoefficientList[Series[Sqrt(2*x*E^x-2*E^x+3), {x, 0, 24}], x] * Range[0, 24]!
-
my(x='x+O('x^30)); Vec(serlaplace(sqrt(2*x*exp(x) - 2*exp(x) + 3))) \\ Michel Marcus, Jul 05 2021
A162973
Number of cycles in all derangement permutations of {1,2,...,n}.
Original entry on oeis.org
0, 1, 2, 12, 64, 425, 3198, 27216, 258144, 2701737, 30933770, 384675148, 5163521856, 74417353985, 1146203362822, 18790377267840, 326682354342336, 6003886529652657, 116305541572943826, 2368629865508978284
Offset: 1
a(4)=12 because in the derangements of {1,2,3,4}, namely (12)(34), (13)(24), (14)(23), (1234), (1243), (1324), (1342), (1423), and (1432), we have a total of 2+2+2+1+1+1+1+1+1=12 cycles.
-
G := exp(-z)*(z+ln(1-z))/(z-1): Gser := series(G, z = 0, 25): seq(factorial(n)*coeff(Gser, z, n), n = 1 .. 22);
-
With[{nn=20},Rest[CoefficientList[Series[Exp[-x] (x+Log[1-x])/(x-1), {x,0,nn}],x] Range[0,nn]!]] (* Harvey P. Dale, Jul 25 2013 *)
-
x='x+O('x^30); concat([0], Vec(serlaplace(exp(-x)*(x+log(1-x))/(x -1)))) \\ G. C. Greubel, Sep 01 2018
A343482
Expansion of the e.g.f. sqrt(-1 + 2 / (1 - x) / exp(x)).
Original entry on oeis.org
1, 0, 1, 2, 6, 24, 135, 930, 7105, 59192, 549360, 5746080, 66713361, 839528052, 11308954657, 163038260294, 2520332282910, 41640324943968, 730119174449151, 13507292654421390, 263004450921933817, 5385277610047242620, 115775314245285797256, 2606072891349667903152, 61248210450060537498321
Offset: 0
sqrt(-1+2/(1-x)/exp(x)) = 1 + x^2/2! + 2*x^3/3! + 6*x^4/4! + 24*x^5/5! + 135*x^6/6! + 930*x^7/7! + 7105*x^8/8! + 59192*x^9/9! + ...
a(23) = Sum_{k=1..11} (-1)^(k-1)*A014304(k-1)*A008306(23,k) = 2606072891349667903152.
For k=1, (-1)^(1-1)*A014304(1-1)*A008306(23,1) == -1 (mod 23), because A014304(0) = 1 and A008306(23,1) = (23-1)!
For k>=2, (-1)^(k-1)*A014304(k-1)*A008306(23,k) == 0 (mod 23), because A008306(23,k) == 0 (mod 23), result a(23) == -1 (mod 23).
a(18) = Sum_{k=1..9} (-1)^(k-1)*A014304(k-1)*A008306(18,k) = 730119174449151.
a(18) == 0 (mod (18-1)), because for k >= 1, A008306(18,k) == 0 (mod 17).
-
A014304:= proc(n) option remember; `if`(n=0, 1, (-1)^n + add(binomial(n,k)*A014304(k)* A014304(n-k-1), k=0..n-1)) end:
A008306 := proc(n, k): if k=1 then (n-1)! ; elif n<=2*k-1 then 0; else (n-1)*procname(n-1, k)+(n-1)*procname(n-2, k-1) ; end if; end proc:
a:= n-> add(((-1)^(k-1)*A014304(k-1)*A008306(n,k)), k=1..iquo(n,2)):a(0):=1 ; seq(a(n), n=0..24);
# second program:
a := series(sqrt(-1+2/(1-x)/exp(x)), x=0, 25):seq(n!*coeff(a, x, n), n=0..24);
-
CoefficientList[Series[Sqrt[-1+2/(1-x)/E^x], {x, 0, 24}], x] * Range[0, 24]!
-
my(x='x+O('x^30)); Vec(serlaplace(sqrt(-1 + 2 / (1 - x) / exp(x)))) \\ Michel Marcus, Jul 06 2021
A358622
Regular triangle read by rows. T(n, k) = [[n, k]], where [[n, k]] are the second order Stirling cycle numbers (or second order reciprocal Stirling numbers). T(n, k) for 0 <= k <= n.
Original entry on oeis.org
1, 0, 0, 0, 1, 0, 0, 2, 0, 0, 0, 6, 3, 0, 0, 0, 24, 20, 0, 0, 0, 0, 120, 130, 15, 0, 0, 0, 0, 720, 924, 210, 0, 0, 0, 0, 0, 5040, 7308, 2380, 105, 0, 0, 0, 0, 0, 40320, 64224, 26432, 2520, 0, 0, 0, 0, 0, 0, 362880, 623376, 303660, 44100, 945, 0, 0, 0, 0, 0
Offset: 0
Triangle T(n, k) starts:
[0] 1;
[1] 0, 0;
[2] 0, 1, 0;
[3] 0, 2, 0, 0;
[4] 0, 6, 3, 0, 0;
[5] 0, 24, 20, 0, 0, 0;
[6] 0, 120, 130, 15, 0, 0, 0;
[7] 0, 720, 924, 210, 0, 0, 0, 0;
[8] 0, 5040, 7308, 2380, 105, 0, 0, 0, 0;
[9] 0, 40320, 64224, 26432, 2520, 0, 0, 0, 0, 0;
- Ronald L. Graham, Donald E. Knuth, and Oren Patashnik, Concrete Mathematics, Addison-Wesley, Reading, 2nd ed. 1994, thirty-fourth printing 2022.
A008306 is an irregular subtriangle with more information.
-
P := (n, x) -> (-x)^n*hypergeom([-n, x], [], 1/x):
row := n -> seq(coeff(simplify(P(n, x)), x, k), k = 0..n):
for n from 0 to 9 do row(n) od;
# Alternative:
T := (n, k) -> add(binomial(n, k - j)*abs(Stirling1(n - k + j, j))*(-1)^(k - j), j = 0..k): for n from 0 to 9 do seq(T(n, k), k = 0..n) od;
# Using the e.g.f.:
egf := (exp(t)*(1 - t))^(-z): ser := series(egf, t, 12):
seq(print(seq(n!*coeff(coeff(ser, t, n), z, k), k=0..n)), n = 0..9);
# Using second order Eulerian numbers:
A358622 := proc(n, k) local j;
add(binomial(j, n - 2*k)*combinat:-eulerian2(n - k, j), j = 0..n-k) end:
seq(seq(A358622(n, k), k = 0..n), n = 0..12);
# Using generalized Laguerre polynomials:
P := (n, x) -> (-1)^n*n!*LaguerreL(n, -n - x, -x):
row := n -> seq(coeff(simplify(P(n, x)), x, k), k = 0..n):
seq(print(row(n)), n = 0..9);
-
# recursion over rows
from functools import cache
@cache
def StirlingCycleOrd2(n: int) -> list[int]:
if n == 0: return [1]
if n == 1: return [0, 0]
rov: list[int] = StirlingCycleOrd2(n - 2)
row: list[int] = StirlingCycleOrd2(n - 1) + [0]
for k in range(1, n // 2 + 1):
row[k] = (n - 1) * (rov[k - 1] + row[k])
return row
for n in range(9): print(StirlingCycleOrd2(n))
# Alternative, using function BellMatrix from A264428.
from math import factorial
def f(k: int) -> int:
return factorial(k) if k > 0 else 0
print(BellMatrix(f, 9))
Comments