In mathematics, an alternating factorial is the absolute value of the alternating sum of the first n factorials of positive integers. This is the same as their sum, with the odd-indexed factorials multiplied by −1 if n is even, and the even-indexed factorials multiplied by −1 if n is odd, resulting in an alternation of signs of the summands (or alternation of addition and subtraction operators, if preferred). To put it algebraically, af(n)=∑i=1n(−1)n−ii! or with the recurrence relation af(n)=n!−af(n−1) in which af(n) is 1. The first few alternating factorials are
For example, the third alternating factorial is 1! – 2! + 3!. The fourth alternating factorial is −1! + 2! − 3! + 4! = 19. Regardless of the parity of n!, the last (nth) summand, n!, is given a positive sign, the (n−1)st summand is given a negative sign, and the signs of the lower-indexed summands are alternated accordingly. Živković (1999) proved that there are only a finite number of alternating factorials that are also prime numbers, since 3612703 divides af(3612702) and therefore divides af(n) for all n ≥ 3612702. The primes are af(n) for
with several higher probable primes that have not been proven prime.
References
External links Weisstein, Eric W. "Alternating Factorial". MathWorld.