TOPICS
Search

Alternating Factorial


The alternating factorial is defined as the sum of consecutive factorials with alternating signs,

 a(n)=sum_(k=1)^n(-1)^(n-k)k!.
(1)

It can be given in closed form as

 a(n)=(-1)^n[-1-eEi(-1)+(-1)^nE_(n+2)(1)Gamma(n+2)],
(2)

where Ei(x) is the exponential integral, E_n(x) is the En-function, and Gamma(x) is the gamma function.

The alternating factorial is implemented in the Wolfram Language as AlternatingFactorial[n].

A simple recurrence equation for a(n) is given by

 a(n)=n!-a(n-1),
(3)

where a(1)=1.

For n=1, 2, ..., the first few values are 1, 1, 5, 19, 101, 619, 4421, 35899, ... (OEIS A005165).

Alternating factorial primes are alternating factorials that are prime.


See also

Alternating Factorial Prime, Factorial, Factorial Sums

Explore with Wolfram|Alpha

References

Guy, R. K. "Equal Products of Factorials," "Alternating Sums of Factorials," and "Equations Involving Factorial n." §B23, B43, and D25 in Unsolved Problems in Number Theory, 2nd ed. New York: Springer-Verlag, pp. 80, 100, and 193-194, 1994.Sloane, N. J. A. Sequence A005165/M3892 in "The On-Line Encyclopedia of Integer Sequences."

Referenced on Wolfram|Alpha

Alternating Factorial

Cite this as:

Weisstein, Eric W. "Alternating Factorial." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/AlternatingFactorial.html

Subject classifications