%I M0373 N0140 #123 May 20 2023 07:10:23
%S 1,-1,2,-2,8,8,112,656,5504,49024,491264,5401856,64826368,842734592,
%T 11798300672,176974477312,2831591702528,48137058811904,
%U 866467058876416,16462874118127616,329257482363600896,6914407129633521664,152116956851941670912
%N Expansion of e.g.f. exp(-2*x)/(1-x).
%C A010843, A000023, A000166, A000142, A000522, A010842, A053486, A053487 are successive binomial transforms with the e.g.f. exp(k*x)/(1-x) and recurrence b(n) = n*b(n-1)+k^n and are related to incomplete gamma functions at k. In this case k=-2, a(n) = n*a(n-1)+(-2)^n = Gamma(n+1,k)*exp(k) = Sum_{i=0..n} (-1)^(n-i)*binomial(n,i)*i^(n-i)*(i+k)^i. - _Vladeta Jovovic_, Aug 19 2002
%C a(n) is the permanent of the n X n matrix with -1's on the diagonal and 1's elsewhere. - _Philippe Deléham_, Dec 15 2003
%D J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 210.
%D N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H Simon Plouffe, <a href="/A000023/b000023.txt">Table of n, a(n) for n = 0..250</a>
%H A. R. Kräuter, <a href="http://www.mat.univie.ac.at/~slc/opapers/s09kraeu.html">Permanenten - Ein kurzer Überblick</a>, Séminaire Lotharingien de Combinatoire, B09b (1983), 34 pp.
%H A. R. Kräuter, <a href="http://www.mat.univie.ac.at/~slc/opapers/s11kraeu.html">Über die Permanente gewisser zirkulärer Matrizen...</a>, Séminaire Lotharingien de Combinatoire, B11b (1984), 11 pp.
%F a(n) = Sum_{k=0..n} A008290(n,k)*(-1)^k. - _Philippe Deléham_, Dec 15 2003
%F a(n) = Sum_{k=0..n} (-2)^(n-k)*n!/(n-k)! = Sum_{k=0..n} binomial(n, k)*k!*(-2)^(n-k). - _Paul Barry_, Aug 26 2004
%F a(n) = exp(-2)*Gamma(n+1,-2) (incomplete Gamma function). - _Mark van Hoeij_, Nov 11 2009
%F a(n) = b such that (-1)^n*Integral_{x=0..2} x^n*exp(x) dx = c + b*exp(2). - _Francesco Daddi_, Aug 01 2011
%F G.f.: hypergeom([1,k],[],x/(1+2*x))/(1+2*x) with k=1,2,3 is the generating function for A000023, A087981, and A052124. - _Mark van Hoeij_, Nov 08 2011
%F D-finite with recurrence: - a(n) + (n-2)*a(n-1) + 2*(n-1)*a(n-2) = 0. - _R. J. Mathar_, Nov 14 2011
%F E.g.f.: 1/E(0) where E(k) = 1 - x/(1-2/(2-(k+1)/E(k+1))); (continued fraction). - _Sergei N. Gladkovskii_, Nov 21 2011
%F G.f.: 1/Q(0), where Q(k) = 1 + 2*x - x*(k+1)/(1 - x*(k+1)/Q(k+1)); (continued fraction). - _Sergei N. Gladkovskii_, Apr 19 2013
%F G.f.: 1/Q(0), where Q(k) = 1 - x*(2*k-1) - x^2*(k+1)^2/Q(k+1); (continued fraction). - _Sergei N. Gladkovskii_, Sep 30 2013
%F a(n) = Sum_{k=0..n} (-1)^(n+k)*binomial(n, k)*!k, where !k is the subfactorial A000166. a(n) = (-2)^n*hypergeom([1, -n], [], 1/2). - _Vladimir Reshetnikov_, Oct 18 2015
%F For n >= 3, a(n) = r - (-1)^n mod((-1)^n r, 2^(n - floor((2/n) + log_2(n)))) where r = {n! * e^(-2) - (-2)^(n+1)/(n+1)}. - _Stan Wagon_, May 02 2016
%F 0 = +a(n)*(+4*a(n+1) -2*a(n+3)) + a(n+1)*(+4*a(n+1) +3*a(n+2) -a(n+3)) +a(n+2)*(+a(n+2)) if n>=0. - _Michael Somos_, Nov 20 2018
%F a(n) = KummerU(-n, -n, -2). - _Peter Luschny_, May 10 2022
%e G.f. = 1 - x + 2*x^2 - 2*x^3 + 8*x^4 + 8*x^5 + 112*x^6 + 656*x^7 + ... - _Michael Somos_, Nov 20 2018
%p a := n -> n!*add(((-2)^k/k!), k=0..n): seq(a(n), n=0..27); # _Zerinvary Lajos_, Jun 22 2007
%p seq(simplify(KummerU(-n, -n, -2)), n = 0..22); # _Peter Luschny_, May 10 2022
%t FoldList[#1*#2 + (-2)^#2 &, 1, Range[22]] (* _Robert G. Wilson v_, Jul 07 2012 *)
%t With[{r = Round[n!/E^2 - (-2)^(n + 1)/(n + 1)]}, r - (-1)^n Mod[(-1)^n r, 2^(n + Ceiling[-(2/n) - Log[2, n]])]] (* _Stan Wagon_ May 02 2016 *)
%t a[n_] := (-1)^n x D[1/x Exp[x], {x, n}] x^n Exp[-x]
%t Table[a[n] /. x -> 2, {n, 0, 22}](* _Gerry Martens_ , May 05 2016 *)
%o (PARI) a(n)=if(n<0,0,n!*polcoeff(exp(-2*x+x*O(x^n))/(1-x),n))
%o (Haskell)
%o a000023 n = foldl g 1 [1..n]
%o where g n m = n*m + (-2)^m
%o -- _James Spahlinger_, Oct 08 2012
%o (Sage)
%o @CachedFunction
%o def A000023(n):
%o if n == 0: return 1
%o return n * A000023(n-1) + (-2)**n
%o [A000023(i) for i in range(23)] # _Peter Luschny_, Oct 17 2012
%o (PARI) x='x+O('x^66); Vec( serlaplace( exp(-2*x)/(1-x)) ) \\ _Joerg Arndt_, Oct 06 2013
%Y Cf. A087891, A008290 A089258.
%Y Cf. also A010843, A000166, A000142, A000522, A010842, A053486, A053487.
%K sign,easy
%O 0,3
%A _N. J. A. Sloane_