%I M2321 #148 Sep 15 2024 20:24:02
%S 3,4,6,7,12,14,30,32,33,38,94,166,324,379,469,546,974,1963,3507,3610,
%T 6917,21480,34790,94550,103040,147855,208003
%N Numbers k such that k! - 1 is prime.
%C The corresponding primes n!-1 are often called factorial primes.
%D J.-M. De Koninck, Ces nombres qui nous fascinent, Entry 166, p. 53, Ellipses, Paris 2008.
%D R. K. Guy, Unsolved Problems in Number Theory, Section A2.
%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%D David Wells, The Penguin Dictionary of Curious and Interesting Numbers. Penguin Books, NY, 1986, Revised edition 1987. See entry 719 at p. 160.
%H 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 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 Chris K. Caldwell, <a href="https://t5k.org/top20/page.php?id=30">Factorial Primes</a>.
%H 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 P. Carmody, <a href="http://83.143.57.194:16384/Factorial/">Factorial Prime Search Progress Pages</a>.
%H 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 R. K. Guy and N. J. A. Sloane, <a href="/A005648/a005648.pdf">Correspondence, 1985</a>.
%H 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 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 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 R. Ondrejka, <a href="http://www.utm.edu/research/primes/lists/top_ten/">The Top Ten: a Catalogue of Primal Configurations</a>.
%H PrimeGrid, <a href="http://www.primegrid.com/forum_thread.php?id=1336&nowrap=true#26809">World Record Factorial Prime!!!</a>.
%H PrimeGrid, <a href="http://www.primegrid.com/download/fps-94550.pdf">Announcement of 94550</a>, (2010). - _Felix Fröhlich_, Jul 11 2014
%H PrimeGrid, <a href="http://www.primegrid.com/download/fps-103040.pdf">Announcement of 103040</a>, (2010). - _Felix Fröhlich_, Jul 11 2014
%H PrimeGrid, <a href="http://www.primegrid.com/download/FPS-147855.pdf">Announcement of 147855</a>, (2013). - _Felix Fröhlich_, Jul 11 2014
%H 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 Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/Factorial.html">Factorial</a>.
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/FactorialPrime.html">Factorial Prime</a>.
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/IntegerSequencePrimes.html">Integer Sequence Primes</a>.
%H Robert G. Wilson v, <a href="/A002982/a002982.pdf">Letter to N. J. A. Sloane, Jan. 1989</a>.
%H <a href="/index/Fa#factorial">Index entries for sequences related to factorial numbers</a>.
%e From _Gus Wiseman_, Jul 04 2019: (Start)
%e The sequence of numbers n! - 1 together with their prime indices begins:
%e 1: {}
%e 5: {3}
%e 23: {9}
%e 119: {4,7}
%e 719: {128}
%e 5039: {675}
%e 40319: {9,273}
%e 362879: {5,5,430}
%e 3628799: {10,11746}
%e 39916799: {6,7,9,992}
%e 479001599: {25306287}
%e 6227020799: {270,256263}
%e 87178291199: {3610490805}
%e 1307674367999: {7,11,11,16,114905}
%e 20922789887999: {436,318519035}
%e 355687428095999: {8,21,10165484947}
%e 6402373705727999: {17,20157,25293727}
%e 121645100408831999: {119,175195,4567455}
%e 2432902008176639999: {11715,659539127675}
%e (End)
%t Select[Range[10^3], PrimeQ[ #!-1] &] (* _Vladimir Joseph Stephan Orlovsky_, May 01 2008 *)
%o (PARI) is(n)=ispseudoprime(n!-1) \\ _Charles R Greathouse IV_, Mar 21 2013
%o (Magma) [n: n in [0..500] | IsPrime(Factorial(n)-1)]; // _Vincenzo Librandi_, Sep 07 2017
%o (Python)
%o from sympy import factorial, isprime
%o A002982_list = [n for n in range(1,10**2) if isprime(factorial(n)-1)] # _Chai Wah Wu_, Apr 04 2021
%Y Cf. A002981 (numbers n such that n!+1 is prime).
%Y Cf. A055490 (primes of form n!-1).
%Y Cf. A088332 (primes of form n!+1).
%Y Cf. A000142, A001221, A001222, A046051, A054991, A112798, A325272.
%K hard,more,nonn,nice
%O 1,1
%A _N. J. A. Sloane_
%E 21480 sent in by Ken Davis (ken.davis(AT)softwareag.com), Oct 29 2001
%E Updated Feb 26 2007 by _Max Alekseyev_, based on progress reported in the Carmody web site.
%E Inserted missing 21480 and 34790 (see Caldwell). Added 94550, discovered Oct 05 2010. _Eric W. Weisstein_, Oct 06 2010
%E 103040 was discovered by James Winskill, Dec 14 2010. It has 471794 digits. Corrected by _Jens Kruse Andersen_, Mar 22 2011
%E a(26) = 147855 from _Felix Fröhlich_, Sep 02 2013
%E a(27) = 208003 from _Sou Fukui_, Jul 27 2016