TOPICS
Search

Alternating Factorial Prime


An alternating factorial prime is an integer sequence prime that is an alternating factorial

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

that is a prime number. The first few indices n for which a(n) is prime or a probable prime are 3, 4, 5, 6, 7, 8, 10, 15, 19, 41, 59, 61, 105, 160, 661, 2653, 3069, 3943, 4053, 4998, 8275, 9158, 11164, 43592, 59961, ... (OEIS A001272; extending Guy 1994, p. 100). Živković (1999) proved that only finitely many alternating factorials are prime. Specifically, he found that the prime number p=3612703 divides a(p-1), so the recurrence relation a(n+1)=(n+1)!-a(n) shows that p divides a(n) for every n>=p-1=3612702. Under a heuristic model, he estimated the total number of prime values to be about 2lnp approx 30. The number a(661) was verified to be prime in Jul. 2000 by a team of G. La Barbera and others using the Certifix program developed by Marcel Martin (Jobling 2004).

The following table summarizes the largest known alternating factorial probable primes. Rodenkirch (2017) completed a search through n=100000 showing that none of the additional values through that limit is a probable prime. Rodenkirch (2026a) announced plans to sieve through n=1000000. Rodenkirch (2026b) subsequently reported modifying PFGW to support alternating factorials and obtaining a sieve bound of 10^(13), with about 425,000 candidates remaining for 10^4<=n<=10^6. He planned to verify the implementation over 10^4<=n<=10^5.

ndecimal digitsdiscoverer
1116440344P. Jobling, Nov. 25, 2004
43592183312S. Balatov, Jul. 19, 2017
59961260448M. Rodenkirch, Sep. 18, 2017

See also

Alternating Factorial, Factorial Prime, Integer Sequence Primes, Prime Number, Probable Prime

Explore with Wolfram|Alpha

References

Balatov, S. "Alternating Factorials." Jul. 19, 2017. https://www.mersenneforum.org/node/16922#post626995.Guy, R. K. "Alternating Sums of Factorials." §B43 in Unsolved Problems in Number Theory, 2nd ed. New York: Springer-Verlag, p. 100, 1994.Jobling, P. "Guy's Problem B43: Search for Primes of Form n!-(n-1)!+(n-2)!-(n-3)!+...+/-1!." 25 Nov 2004. https://listserv.nodak.edu/cgi-bin/wa.exe?A1=ind0411&L=nmbrthry#4.Rodenkirch, M. "Alternating Factorials." Dec. 15, 2017. https://www.mersenneforum.org/node/16922#post641755.Rodenkirch, M. "Alternating Factorials." Jun. 25, 2026a. https://www.mersenneforum.org/node/16922#post1118364.Rodenkirch, M. "Alternating Factorials." Aug. 27, 2026b. https://www.mersenneforum.org/node/16922#post1124662.Sloane, N. J. A. Sequence A001272 in "The On-Line Encyclopedia of Integer Sequences."Živković, M. "The Number of Primes sum_(i=1)^(n)(-1)^(n-i)i! Is Finite." Math. Comput. 68, 403-409, 1999.

Cite this as:

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

Subject classifications