login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A245756
Least number k such that (k! + n)/k is prime, or 0 if no such k exists.
4
1, 1, 3, 1, 0, 1, 0, 2, 3, 1, 0, 1, 0, 0, 3, 1, 0, 1, 0, 2, 0, 1, 0, 2, 5, 0, 3, 1, 0, 1, 0, 2, 3, 0, 5, 1, 0, 38, 0, 1, 0, 1, 0, 2, 3, 1, 0, 0, 7, 0, 3, 1, 0, 0, 0, 2, 0, 1, 0, 1, 0, 0, 3, 0, 5, 1, 0, 4, 0, 1, 0, 1, 0, 74, 0, 0, 0, 1, 0, 2, 3, 1, 0, 2, 5, 0, 3
OFFSET
1,3
COMMENTS
If a(n) = n, then n is in A090660.
a(n) <= n for all n.
a(n) = 1 if and only if n + 1 is prime.
LINKS
EXAMPLE
(1! + 3)/1 = 4 is not prime.
(2! + 3)/2 = 5/2 is not prime.
(3! + 3)/3 = 3 is prime. Thus a(3) = 3.
PROG
(PARI)
a(n)=for(k=1, n, s=(k!+n)/k; if(floor(s)==s, if(ispseudoprime(s), return(k))))
n=1; while(n<150, print1(a(n), ", "); n++)
CROSSREFS
Cf. A090660.
Sequence in context: A111700 A233316 A060096 * A360672 A322512 A152892
KEYWORD
nonn
AUTHOR
Derek Orr, Jul 31 2014
EXTENSIONS
Corrected by Jens Kruse Andersen, Aug 03 2014
STATUS
approved