# alternating factorial

The alternating factorial $af(n)$ of a positive integer $n$ is the sum

 $af(n)=\sum_{i=1}^{n}(-1)^{n-i}i!,$

which can also be expressed with the recurrence relation $af(n)=n!-af(n-1)$ with starting condition $af(1)=1$. The notation nÃÂ¡! (alternating an inverted exclamation mark with a regular exclamation mark) has been proposed by analogy to that of the double factorial, but has not gained much support, in part because of TeX’s lack of support for Spanish characters.

The first few alternating factorials, listed in A005165 of Sloane’s OEIS, are 1, 5, 19, 101, 619, 4421.

In 1999, Miodrag Zivković proved that $\gcd(n,af(n))=1$ and that the set of alternating factorials that are prime numbers is finite. $af(661)$ is the largest such known prime.

Title alternating factorial AlternatingFactorial 2013-03-22 16:19:59 2013-03-22 16:19:59 PrimeFan (13766) PrimeFan (13766) 7 PrimeFan (13766) Definition msc 05A10