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.
%I A162973 #26 Jul 26 2022 10:43:03 %S A162973 0,1,2,12,64,425,3198,27216,258144,2701737,30933770,384675148, %T A162973 5163521856,74417353985,1146203362822,18790377267840,326682354342336, %U A162973 6003886529652657,116305541572943826,2368629865508978284 %N A162973 Number of cycles in all derangement permutations of {1,2,...,n}. %H A162973 G. C. Greubel, <a href="/A162973/b162973.txt">Table of n, a(n) for n = 1..449</a> %H A162973 John Riordan, <a href="/A002720/a002720_3.pdf">Letter to N. J. A. Sloane, Sep 26 1980 with notes on the 1973 Handbook of Integer Sequences</a>. Note that the sequences are identified by their N-numbers, not their A-numbers. %F A162973 a(n) = Sum_{k>=1} k*A008306(n,k). %F A162973 E.g.f.: exp(-z)*(z+log(1-z))/(z-1). %F A162973 a(n) ~ n! * (log(n) + gamma - 1)/exp(1), where gamma is the Euler-Mascheroni constant (A001620). - _Vaclav Kotesovec_, Sep 25 2013 %F A162973 a(n) = A000254(n) - A162972(n). - _Anton Zakharov_, Oct 18 2016 %F A162973 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 %e A162973 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. %p A162973 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); %t A162973 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 *) %o A162973 (PARI) x='x+O('x^30); concat([0], Vec(serlaplace(exp(-x)*(x+log(1-x))/(x -1)))) \\ _G. C. Greubel_, Sep 01 2018 %Y A162973 Cf. A008306, A162972, A000254. %K A162973 nonn %O A162973 1,3 %A A162973 _Emeric Deutsch_, Jul 22 2009