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 A162972 #15 Jul 26 2022 13:43:19 %S A162972 1,2,9,38,210,1339,9870,82368,768432,7926903,89610070,1101767732, %T A162972 14639237184,209048293375,3192959638778,51943905125760, %U A162972 896723236236864,16373101528868943,315259605244694574,6384318171252621716,135651088007338895680,3017472066675257000775 %N A162972 Number of cycles in all non-derangement permutations of {1,2,...,n}. %C A162972 a(n) = Sum(k*A162971(n,k), k=1..n). %H A162972 Vincenzo Librandi, <a href="/A162972/b162972.txt">Table of n, a(n) for n = 1..200</a> %F A162972 E.g.f.: (z*exp(-z) + (exp(-z)-1)*log(1-z)) / (1-z). %F A162972 a(n) ~ n! * ((1-exp(-1))*(log(n) + gamma) + exp(-1)), where gamma is the Euler-Mascheroni constant (A001620). - _Vaclav Kotesovec_, Oct 02 2013 %F A162972 Conjecture D-finite with recurrence a(n) +(-3*n+8)*a(n-1) +(n-3)*(3*n-14)*a(n-2) +(-n^3+19*n^2-98*n+156)*a(n-3) +(-4*n^3+56*n^2-258*n+395)*a(n-4) +(-6*n^3+84*n^2-395*n+624)*a(n-5) -(n-5)*(4*n^2-41*n+106)*a(n-6) -(n-5)*(n-6)^2*a(n-7)=0. - _R. J. Mathar_, Jul 26 2022 %e A162972 a(3) = 9 because in the 4 non-derangement permutations of {1,2,3,4}, namely (1)(2)(3), (1)(23), (12)(3), (13)(2), we have a total of 3 + 2 + 2 + 2 = 9 cycles. %p A162972 g := (z*exp(-z)+(exp(-z)-1)*ln(1-z))/(1-z): gser := series(g, z = 0, 25): seq(factorial(n)*coeff(gser, z, n), n = 1 .. 22); %t A162972 Rest[CoefficientList[Series[(x*Exp[-x]+(Exp[-x]-1)*Log[1-x])/(1-x), {x, 0, 20}], x]* Range[0, 20]!] (* _Vaclav Kotesovec_, Oct 02 2013 *) %Y A162972 Cf. A162971. %K A162972 nonn %O A162972 1,2 %A A162972 _Emeric Deutsch_, Jul 22 2009 %E A162972 a(21)-a(22) from _Vincenzo Librandi_, Oct 04 2013