 | Alternating factorial: Encyclopedia - Alternating factorial
Alternating factorial
An alternating factorial is the absolute value of the alternating sum of the first n factorials.
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,
or with the recurrence relation
af(n) = n! − af(n − 1)
in which af(1) = 1.
The first few alternating factorials are
1, 1, 5, 19, 101, 619, 4421, 35899, 326981, 3301819, 36614981, 442386619, 5784634181, 81393657019 (sequence A005165 in OEIS)
For example, the third alternating factorial is 1! + −(2!) + 3! = 5, or if preferred, 1! − 2! + 3! The fourth alternating factorial is −(1!) + 2! + −(3!) + 4! = 19. Regardless of the parity of n, the summand n − 1 is given a negative sign and the signs of the lower-indexed summands are alternated accordingly.
This pattern of alternation ensures the resulting sums are all positive integers. Changing the rule so that either the odd- or even-indexed summands are given negative signs (regardless of the parity of n) changes the signs of the resulting sums but not their absolute values.
Except for n = 1, the factorial of n and the alternating factorial of n are coprime. Miodrag Zivković proved in 1999 that there are only a finite number of alternating factorials that are also prime numbers. The largest alternating factorial known to be a prime is the alternating factorial of 661, approximately 7.818097272875 × 101578.
Alternating factorial - Reference
- Yves Gallot, Is the number of primes finite?
Other related archives1, 101, 19, 5, OEIS, absolute value, alternating sum, coprime, factorials, prime numbers, recurrence relation, −1
 Adapted from the Wikipedia article "Alternating factorial", under the G.N U Free Docmentation License. Please also see http://en.wikipedia.org/wiki |