cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A002982 Numbers k such that k! - 1 is prime.

This page as a plain text file.
%I A002982 M2321 #157 Jul 16 2025 13:37:02
%S A002982 3,4,6,7,12,14,30,32,33,38,94,166,324,379,469,546,974,1963,3507,3610,
%T A002982 6917,21480,34790,94550,103040,147855,208003
%N A002982 Numbers k such that k! - 1 is prime.
%C A002982 The corresponding primes n!-1 are often called factorial primes.
%D A002982 J.-M. De Koninck, Ces nombres qui nous fascinent, Entry 166, p. 53, Ellipses, Paris 2008.
%D A002982 R. K. Guy, Unsolved Problems in Number Theory, Section A2.
%D A002982 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%D A002982 James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 118.
%D A002982 David Wells, The Penguin Dictionary of Curious and Interesting Numbers. Penguin Books, NY, 1986, Revised edition 1987. See entry 719 at p. 160.
%H A002982 A. Borning, <a href="http://dx.doi.org/10.1090/S0025-5718-1972-0308018-5">Some results for k!+-1 and 2.3.5...p+-1</a>, Math. Comp., 26:118 (1972), pp. 567-570.
%H A002982 J. P. Buhler et al., <a href="http://dx.doi.org/10.1090/S0025-5718-1982-0645679-1">Primes of the form n!+-1 and 2.3.5....p+-1</a>, Math. Comp., 38:158 (1982), pp. 639-643.
%H A002982 Chris K. Caldwell, <a href="https://t5k.org/top20/page.php?id=30">Factorial Primes</a>.
%H A002982 C. K. Caldwell and Y. Gallot, <a href="http://dx.doi.org/10.1090/S0025-5718-01-01315-1">On the primality of n!+-1 and 2*3*5*...*p+-1</a>, Math. Comp., 71:237 (2002), pp. 441-448.
%H A002982 P. Carmody, <a href="http://83.143.57.194:16384/Factorial/">Factorial Prime Search Progress Pages</a>.
%H A002982 Antonín Čejchan, Michal Křížek, and Lawrence Somer, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL25/Krizek/krizek3.html">On Remarkable Properties of Primes Near Factorials and Primorials</a>, Journal of Integer Sequences, Vol. 25 (2022), Article 22.1.4.
%H A002982 Shyam Sunder Gupta, <a href="https://doi.org/10.1007/978-981-97-2465-9_16">Fascinating Factorials</a>, Exploring the Beauty of Fascinating Numbers, Springer (2025) Ch. 16, 411-442.
%H A002982 R. K. Guy and N. J. A. Sloane, <a href="/A005648/a005648.pdf">Correspondence, 1985</a>.
%H A002982 H. Dubner, <a href="/A006794/a006794.pdf">Factorial and primorial primes</a>, J. Rec. Math., 19 (No. 3, 1987), 197-203. (Annotated scanned copy)
%H A002982 Des MacHale and Joseph Manning, <a href="http://dx.doi.org/10.1017/mag.2015.28">Maximal runs of strictly composite integers</a>, The Mathematical Gazette, 99 (2015), pp 213-219. doi:10.1017/mag.2015.28.
%H A002982 R. Mestrovic, <a href="http://arxiv.org/abs/1202.3670">Euclid's theorem on the infinitude of primes: a historical survey of its proofs (300 BC--2012) and another new proof</a>, arXiv preprint arXiv:1202.3670 [math.HO], 2012.
%H A002982 R. Ondrejka, <a href="http://www.utm.edu/research/primes/lists/top_ten/">The Top Ten: a Catalogue of Primal Configurations</a>.
%H A002982 PrimeGrid, <a href="http://www.primegrid.com/forum_thread.php?id=1336&amp;nowrap=true#26809">World Record Factorial Prime!!!</a>.
%H A002982 PrimeGrid, <a href="http://www.primegrid.com/download/fps-94550.pdf">Announcement of 94550</a>, (2010). - _Felix Fröhlich_, Jul 11 2014
%H A002982 PrimeGrid, <a href="http://www.primegrid.com/download/fps-103040.pdf">Announcement of 103040</a>, (2010). - _Felix Fröhlich_, Jul 11 2014
%H A002982 PrimeGrid, <a href="http://www.primegrid.com/download/FPS-147855.pdf">Announcement of 147855</a>, (2013). - _Felix Fröhlich_, Jul 11 2014
%H A002982 Maxie D. Schmidt, <a href="https://arxiv.org/abs/1701.04741">New Congruences and Finite Difference Equations for Generalized Factorial Functions</a>, arXiv:1701.04741 [math.CO], 2017.
%H A002982 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Factorial.html">Factorial</a>.
%H A002982 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/FactorialPrime.html">Factorial Prime</a>.
%H A002982 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/IntegerSequencePrimes.html">Integer Sequence Primes</a>.
%H A002982 Robert G. Wilson v, <a href="/A002982/a002982.pdf">Letter to N. J. A. Sloane, Jan. 1989</a>.
%H A002982 <a href="/index/Fa#factorial">Index entries for sequences related to factorial numbers</a>.
%e A002982 From _Gus Wiseman_, Jul 04 2019: (Start)
%e A002982 The sequence of numbers n! - 1 together with their prime indices begins:
%e A002982                     1: {}
%e A002982                     5: {3}
%e A002982                    23: {9}
%e A002982                   119: {4,7}
%e A002982                   719: {128}
%e A002982                  5039: {675}
%e A002982                 40319: {9,273}
%e A002982                362879: {5,5,430}
%e A002982               3628799: {10,11746}
%e A002982              39916799: {6,7,9,992}
%e A002982             479001599: {25306287}
%e A002982            6227020799: {270,256263}
%e A002982           87178291199: {3610490805}
%e A002982         1307674367999: {7,11,11,16,114905}
%e A002982        20922789887999: {436,318519035}
%e A002982       355687428095999: {8,21,10165484947}
%e A002982      6402373705727999: {17,20157,25293727}
%e A002982    121645100408831999: {119,175195,4567455}
%e A002982   2432902008176639999: {11715,659539127675}
%e A002982 (End)
%t A002982 Select[Range[10^3], PrimeQ[ #!-1] &] (* _Vladimir Joseph Stephan Orlovsky_, May 01 2008 *)
%o A002982 (PARI) is(n)=ispseudoprime(n!-1) \\ _Charles R Greathouse IV_, Mar 21 2013
%o A002982 (Magma) [n: n in [0..500] | IsPrime(Factorial(n)-1)]; // _Vincenzo Librandi_, Sep 07 2017
%o A002982 (Python)
%o A002982 from sympy import factorial, isprime
%o A002982 A002982_list = [n for n in range(1,10**2) if isprime(factorial(n)-1)] # _Chai Wah Wu_, Apr 04 2021
%Y A002982 Cf. A002981 (numbers n such that n!+1 is prime).
%Y A002982 Cf. A055490 (primes of form n!-1).
%Y A002982 Cf. A088332 (primes of form n!+1).
%Y A002982 Cf. A000142, A001221, A001222, A046051, A054991, A112798, A325272.
%K A002982 hard,more,nonn,nice
%O A002982 1,1
%A A002982 _N. J. A. Sloane_
%E A002982 21480 sent in by Ken Davis (ken.davis(AT)softwareag.com), Oct 29 2001
%E A002982 Updated Feb 26 2007 by _Max Alekseyev_, based on progress reported in the Carmody web site.
%E A002982 Inserted missing 21480 and 34790 (see Caldwell). Added 94550, discovered Oct 05 2010. _Eric W. Weisstein_, Oct 06 2010
%E A002982 103040 was discovered by James Winskill, Dec 14 2010. It has 471794 digits. Corrected by _Jens Kruse Andersen_, Mar 22 2011
%E A002982 a(26) = 147855 from _Felix Fröhlich_, Sep 02 2013
%E A002982 a(27) = 208003 from _Sou Fukui_, Jul 27 2016