This site is supported by donations to The OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A173184 Partial sums of A000166. 2
 1, 1, 2, 4, 13, 57, 322, 2176, 17009, 150505, 1485466, 16170036, 192384877, 2483177809, 34554278858, 515620794592, 8212685046337, 139062777326001, 2494364438359954, 47245095998005060, 942259727190907181 (list; graph; refs; listen; history; text; internal format)
 OFFSET 0,3 COMMENTS Partial sums of subfactorial or rencontres numbers, or derangements (number of permutations of n elements with no fixed points). The subsequence of primes begins: 2, 13, 192384877. LINKS FORMULA G.f.: 1/U(0)/(1-x) where U(k) = 1 + x - x*(k+1)/(1 - x*(k+1)/U(k+1)); (continued fraction). - Sergei N. Gladkovskii, Oct 15 2012 G.f.: 1/(1 - x^2) + (1/(1 - x))*Sum_{k>=1} k^k*x^k/(1 + (k + 1)*x)^(k+1). - Ilya Gutkovskiy, Apr 13 2017 From Emanuele Munarini, Oct 06 2017: (Start) E.g.f: exp(-t)/(1-t) - exp(t-2)*(coshIntegral(2-2*t) + sinhIntegral(2-2*t) - expIntegralEi(2)). a(n+2) - (n+3)*a(n+1) + (n+2)*a(n) = (-1)^n. (End) a(n+3) - (n+3)*a(n+2) + (n+2)*a(n) = 0. - Emanuele Munarini, Aug 24 2017 EXAMPLE a(3) = 1 + 0 + 1 + 2 = 4. MATHEMATICA a[0] = 1; a[n_] := a[n] = n*a[n - 1] + (-1)^n; Accumulate@ Array[a, 21, 0] (* Robert G. Wilson v, Apr 01 2011 *) dr[{n_, a1_, a2_}]:={n+1, a2, n(a1+a2)}; Accumulate[Transpose[NestList[dr, {0, 0, 1}, 30]][[3]]] (* Harvey P. Dale, Jul 17 2014 *) Table[Sum[Subfactorial[k], {k, 0, n}], {n, 0, 100}] (* Emanuele Munarini, Aug 24 2017 *) PROG (Maxima) s[0]:1\$ s[n]:=n*s[n-1]+(-1)^n\$ makelist(sum(s[k], k, 0, n), n, 0, 12); /* Emanuele Munarini, Aug 24 2017 */ CROSSREFS Cf. A000166. Sequence in context: A030862 A030923 A039831 * A111977 A201691 A020120 Adjacent sequences:  A173181 A173182 A173183 * A173185 A173186 A173187 KEYWORD nonn AUTHOR Jonathan Vos Post, Feb 12 2010 STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified May 26 13:05 EDT 2019. Contains 323586 sequences. (Running on oeis4.)