OFFSET
1,3
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..449
John Riordan, Letter to N. J. A. Sloane, Sep 26 1980 with notes on the 1973 Handbook of Integer Sequences. Note that the sequences are identified by their N-numbers, not their A-numbers.
Natalia L. Skirrow, second-order Stirling series
FORMULA
a(n) = Sum_{k=1..floor(n/2)} k*A008306(n,k).
E.g.f.: exp(-z)*(z+log(1-z))/(z-1).
a(n) ~ exp(-1) * n! * (log(n) + gamma - 1), where gamma is the Euler-Mascheroni constant (A001620). - Vaclav Kotesovec, Sep 25 2013
D-finite with recurrence a(n) +2*(-n+2)*a(n-1) +(n-2)*(n-6)*a(n-2) +(3*n-8)*(n-3)*a(n-3) +3*(n-3)^2*a(n-4) +(n-3)*(n-4)*a(n-5)=0. - R. J. Mathar, Jul 26 2022
From Natalia L. Skirrow, Sep 11 2025: (Start)
a(n) = Sum_{b=2..n} n!/(b*(n-b)!) * A000166(n-b).
a(n) = Sum_{k=0..n-1} (-1)^k*n!/k! * (H_{n-k} - 1).
a(n) ~ (n!/e) * (H_n - 1 + Sum_{j>=0} (Integral_{x=-1..0} Bell_j(x)) / n^(j+1)). (Formal but divergent Laurent series; compare with Ramanujan's for A000166.)
With L(n) = (n!/e) * ( H_n - 1 + Integral_{t>=0} (1-e^(1-e^t)) / ((e^t-1)*e^(n*t)) ),
a(n) = ceiling(L(n)) if n even else floor(L(n)) (See my link for proof.)
a(n) - L(n) = (n!/e) * Integral_{t>=0} (e^(1-e^t-n*t)*g(n,-e^t) - e^-t*g(n,-1)) / ((e^t-1)*(n-1)!), where g is the lower incomplete gamma function.
(End)
EXAMPLE
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.
MAPLE
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);
MATHEMATICA
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 *)
PROG
(PARI) x='x+O('x^30); concat([0], Vec(serlaplace(exp(-x)*(x+log(1-x))/(x -1)))) \\ G. C. Greubel, Sep 01 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Emeric Deutsch, Jul 22 2009
STATUS
approved
