login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A235378
a(n) = (-1)^n*(n! - (-1)^n).
2
-2, 1, -7, 23, -121, 719, -5041, 40319, -362881, 3628799, -39916801, 479001599, -6227020801, 87178291199, -1307674368001, 20922789887999, -355687428096001, 6402373705727999, -121645100408832001, 2432902008176639999, -51090942171709440001, 1124000727777607679999
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
Cf. A000240.
Sequence in context: A013075 A009281 A141516 * A214327 A320519 A183272
KEYWORD
sign,easy
AUTHOR
STATUS
approved