cp's OEIS Frontend

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.

A173184 Partial sums of A000166.

Original entry on oeis.org

1, 1, 2, 4, 13, 57, 322, 2176, 17009, 150505, 1485466, 16170036, 192384877, 2483177809, 34554278858, 515620794592, 8212685046337, 139062777326001, 2494364438359954, 47245095998005060, 942259727190907181, 19737566982241851721, 433234326593362631602
Offset: 0

Views

Author

Jonathan Vos Post, Feb 12 2010

Keywords

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.

Examples

			a(3) = 1 + 0 + 1 + 2 = 4.
		

Crossrefs

Programs

  • 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 *)
  • 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 */

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)
D-finite with recurrence a(n+3) - (n+3)*a(n+2) + (n+2)*a(n) = 0. - Emanuele Munarini, Aug 24 2017