OFFSET
1,1
COMMENTS
This sequence links rencontres numbers r(n) with Sum_{k>=1} 1/((k+n)*k!) = (a(n) + (-1)^(n+1)*e*r(n))/n.
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..448 (terms 1..40 from Jean-François Alcover)
FORMULA
Recurrence: a(1)=-2, a(2)=1; for n>2, a(n) = -n*a(n-1) - n - 1.
E.g.f.: 1/(1+x) - exp(x).
D-finite with recurrence: a(n) +(n-2)*a(n-1) +(-2*n+3)*a(n-2) +(n-2)*a(n-3)=0. - R. J. Mathar, Feb 24 2020
a(1) = -2; For a > 1: a(n) = (-1)^n*Sum_{j=0..n-1} (abs(Stirling1(n,j) + binomial(n - 1, j))). - Detlef Meya, Apr 11 2024
MATHEMATICA
r[n_] := n*Subfactorial[n-1]; a[n_] := n*Sum[1/((k + n)*k!), {k, 1, Infinity}] + (-1)^n*E*r[n]; Table[a[n], {n, 1, 25}]
(* or, simply: *) Table[(-1)^n*(n!-(-1)^n), {n, 1, 25}]
a[1]:=-2; a[n]:=(-1)^n*Sum[Abs[StirlingS1[n, j]+Binomial[n-1, j]], {j, 0, n-1}]; Flatten[Table[a[n], {n, 1, 19}]] (* Detlef Meya, Apr 11 2024 *)
PROG
(PARI) for(n=1, 30, print1((-1)^n*(n!-(-1)^n), ", ")) \\ G. C. Greubel, Nov 21 2017
(Magma) [(-1)^n*(Factorial(n) - (-1)^n): n in [1..30]]; // G. C. Greubel, Nov 21 2017
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Jean-François Alcover, Jan 08 2014
STATUS
approved