%I #74 Nov 21 2024 05:32:38
%S 1,5,7,11,29,773,1321,2621
%N Numbers k such that ((k-1)! + 1)/k is prime.
%C Except for the first term, all terms are primes because for n > 1, n divides (n-1)! + 1 iff n is prime. - _Farideh Firoozbakht_, Mar 19 2004
%C a(9) >= 30941.
%H Mike Oakes, <a href="https://listserv.nodak.edu/cgi-bin/wa.exe?A2=NMBRTHRY;c834cb27.0308">posting to Number Theory List, Aug 20 2003</a>
%H Jonathan Sondow, <a href="http://arxiv.org/abs/1110.3113">Lerch Quotients, Lerch Primes, Fermat-Wilson Quotients, and the Wieferich-non-Wilson Primes 2, 3, 14771</a>, in Proceedings of CANT 2011, arXiv:1110.3113 [math.NT], 2011-2012.
%H Jonathan Sondow, <a href="http://dx.doi.org/10.1007/978-1-4939-1601-6_17">Lerch Quotients, Lerch Primes, Fermat-Wilson Quotients, and the Wieferich-non-Wilson Primes 2, 3, 14771</a>, Combinatorial and Additive Number Theory, CANT 2011 and 2012, Springer Proc. in Math. & Stat., vol. 101 (2014), pp. 243-255.
%H Javier Soria, <a href="https://listserv.nodak.edu/cgi-bin/wa.exe?A2=NMBRTHRY;11dff936.0304">posting to Number Theory List, Apr 08 2003</a>
%F ((a(n)-1)! + 1)/a(n) = A122696(n) = A007619(A000720(A050299(n))) for n > 1. - _Jonathan Sondow_, Aug 07 2011
%F a(n) = prime(A225906(n-1)) for n > 1. - _Jonathan Sondow_, May 20 2013
%e 7 is in the sequence because (6!+1)/7=103 is prime.
%t v={1};Do[If[PrimeQ[((Prime[n]-1)!+1)/Prime[n]], v=Append[v, Prime[n]];Print[v]], {n, 845}]
%t Select[Range[2630],PrimeQ[((#-1)!+1)/#]&] (* _Harvey P. Dale_, Aug 18 2024 *)
%o (PARI) is(n)=((n-1)!+1)%n==0 && isprime(((n-1)!+1)/n) \\ _Anders Hellström_, Nov 22 2015
%K nonn,more
%O 1,2
%A _N. J. A. Sloane_, Apr 09 2003
%E a(7)-a(8) from _Mike Oakes_, Aug 20 2003