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”).

A240160
Least number k such that (k!-n)/k is prime, or 0 if no such k exists.
2
0, 0, 0, 4, 5, 0, 7, 8, 0, 0, 0, 4, 13, 0, 15, 4, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 31, 0, 33, 34, 5, 0, 0, 0, 39, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5
OFFSET
1,4
COMMENTS
For a(n) > 0, a(n) is a divisor of n.
If a(n) = n, then n - 1 is in A002982.
LINKS
PROG
(PARI)
a(n)=for(k=1, n, s=(k!-n)/k; if(floor(s)==s, if(ispseudoprime(s), return(k))))
vector(150, n, a(n))
CROSSREFS
KEYWORD
nonn
AUTHOR
Derek Orr, Aug 01 2014
EXTENSIONS
Typo in PARI code fixed by Colin Barker, Aug 02 2014
STATUS
approved