login
a(n) = (-1)^n * n!.
23

%I #108 Aug 17 2024 23:04:24

%S 1,-1,2,-6,24,-120,720,-5040,40320,-362880,3628800,-39916800,

%T 479001600,-6227020800,87178291200,-1307674368000,20922789888000,

%U -355687428096000,6402373705728000,-121645100408832000,2432902008176640000

%N a(n) = (-1)^n * n!.

%C A variant of A000142, the factorial numbers. - _N. J. A. Sloane_, Oct 03 2007

%C The terms of this sequences form the factorial series which Euler called the divergent series par excellence.

%C Euler summed this series to 0.596347... (A073003 = Gompertz's constant).

%C Sum_{n>=0} 1/a(n) = 1/e. - _Jaume Oliver Lafont_, Mar 03 2009

%C A002104(n+1) = p(-1) where p(x) is the unique degree-n polynomial such that p(k) = a(k) for k = 0, 1, ..., n. - _Michael Somos_, Apr 30 2012

%C a(n) = A048594(2*n+1, n+1). - _Reinhard Zumkeller_, Mar 02 2014

%C log(1+x) = Sum_{n>=1} a(n-1)/n!*x^n. - _James R. Buddenhagen_, May 24 2015

%C It seems that a(n) is the determinant of n+1 X n+1 matrix whose elements are m(i,j) = quotient(i/j) + remainder(i/j). - _Andres Cicuttin_, Feb 11 2018

%D A. N. Khovanskii. The Application of Continued Fractions and Their Generalizations to Problem in Approximation Theory. Groningen: Noordhoff, Netherlands, 1963. See p. 141 (10.19)

%D R. Roy, Sources in the Development of Mathematics, Cambridge University Press, 2011. See p. 186.

%H Iain Fox, <a href="/A133942/b133942.txt">Table of n, a(n) for n = 0..449</a> (first 161 terms from Vincenzo Librandi)

%H Jeffrey C. Lagarias, <a href="https://doi.org/10.1090/S0273-0979-2013-01423-X">Euler's constant: Euler's work and modern developments</a>, Bull. Amer. Math. Soc., Vol. 50, No. 4 (2013), pp. 527-628; <a href="http://arxiv.org/abs/1303.1856">preprint</a>, arXiv:1303.1856 [math.NT], 2013.

%H V. S. Varadarajan, <a href="http://dx.doi.org/10.1090/S0273-0979-07-01175-5">Euler and his Work on Infinite Series</a>, Bull. Amer. Math. Soc., 44 (No. 4, 2007), 515-539. (See p. 527 and 530.)

%H <a href="/index/Fa#factorial">Index entries for sequences related to factorial numbers</a>

%F Sum_{i=0..n} (-1)^i * i^n * binomial(n, i) = (-1)^n * n!. - Yong Kong (ykong(AT)curagen.com), Dec 26 2000

%F Stirling transform of a(n) = [1, -1, 2, -6, 24, ...] is A000007(n) = [1, 0, 0, 0, 0, ...].

%F a(n) = -n * a(n-1) unless n=0. a(n) = (-1)^n * A000142(n).

%F E.g.f.: 1/(1 + x).

%F G.f.: integral(t=1/x,infinity, (e^-t)/t) e^(1/x)/x = 1/(1 + x/(1 + x/(1 + 2*x/(1 + 2*x/(1 + 3*x/(1 + 3*x/(1 + ...))))))).

%F Convolution inverse of A158882. HANKEL transform is A055209. PSUM transform is A058006. BIN1 transform is A002741(n+1). - _Michael Somos_, Apr 30 2012

%F G.f.: 1 - x/(G(0)+x) where G(k) = 1 + (k+1)*x/(1 + x*(k+2)/G(k+1)), G(0) = W(1,1;x)/W(1,2;x), W(a,b,x) = 1 - a*b*x/1! + a*(a+1)*b*(b+1)*x^2/2! - ... + a*(a+1)*...*(a+n-1)*b*(b+1)*...*(b+n-1)*x^n/n! + ...; see [A. N. Khovanskii, p. 141 (10.19)]; (continued fraction, 2-step). - _Sergei N. Gladkovskii_, Aug 14 2012

%F G.f.: 1/U(0) where U(k) = 1 + x*(k+1)/(1 + x*(k+1)/U(k+1)); (continued fraction, 2-step). - _Sergei N. Gladkovskii_, Oct 15 2012

%F a(n) = (-1)^n*det(S(i+1,j)|, 1 <= i,j <= n), where S(n,k) are Stirling numbers of the second kind. - _Mircea Merca_, Apr 06 2013

%F G.f.: 2/G(0), where G(k)= 1 + 1/(1 - 2*x*(k+1)/(2*x*(k+1) + 1 + 2*x*(k+1)/G(k+1))); (continued fraction). - _Sergei N. Gladkovskii_, May 30 2013

%F E.g.f.: 1/(1 + x)= G(0), where G(k) = 1 - x*(k+1)*(k+2)/(1 + (k+1)/G(k+1) ); (continued fraction). - _Sergei N. Gladkovskii_, Jan 29 2014

%F For n >= 1, a(n) = round(zeta^(n)(2)), where zeta^(n) is the n-th derivative of the Riemann zeta function. - _Iain Fox_, Nov 13 2017

%F a(n) = (n+1)^(n+1) * Integral_{x=0..1} (x*log(x))^n dx. - _Peter James Foreman_, Oct 27 2018

%e G.f. = 1 - x + 2*x^2 - 6*x^3 + 24*x^4 - 120*x^5 + 720*x^6 - 5040*x^7 + ...

%p seq((-1)^n*factorial(n),n=0..20); # _Muniru A Asiru_, Oct 27 2018

%t nn=20;CoefficientList[Series[1/(1+x),{x,0,nn}],x]Range[0,nn]! (* or *)

%t RecurrenceTable[{a[0]==1,a[n]==-n*a[n-1]},a[n],{n,20}]] (* _Harvey P. Dale_, May 10 2011 and slightly modified by _Robert G. Wilson v_, Feb 12 2018 *)

%t a[n_] := (-1)^n*n!; Array[a, 22, 0] (* _Robert G. Wilson v_, Feb 11 2018 *)

%t Times@@@Partition[Riffle[Range[0,30]!,{1,-1}],2] (* _Harvey P. Dale_, Dec 30 2019 *)

%o (PARI) {a(n) = if( n<0, 0, (-1)^n * n! )};

%o (Magma) [(-1)^n * Factorial(n): n in [0..25]]; // _Vincenzo Librandi_, May 12 2011

%o (Haskell)

%o a133942 n = a133942_list !! n

%o a133942_list = zipWith (*) a000142_list $ cycle [1, -1]

%o -- _Reinhard Zumkeller_, Mar 02 2014

%o (Python)

%o import math

%o for n in range(0, 25): print((-1)**n*math.factorial(n), end=', ') # _Stefano Spezia_, Oct 27 2018

%o (GAP) List([0..20],n->(-1)^n*Factorial(n)); # _Muniru A Asiru_, Oct 27 2018

%Y Partial sums are A058006.

%Y Alternating row sums of A048994.

%Y Also, a(n) = A048994(n+1,1).

%Y Cf. A000142, A002104, A002741, A055209, A158882.

%K sign

%O 0,3

%A _Michael Somos_, Sep 30 2007