OFFSET
3,2
COMMENTS
a(n) < n! for all n > 2.
a(n) = n times (least m >= 0 such that (n-1)!-m is prime) = n*A033933(n-1). - Jens Kruse Andersen, Jul 30 2014 (This shows that a(n) always exists.)
LINKS
Jens Kruse Andersen, Table of n, a(n) for n = 3..2001
EXAMPLE
(6!-42)/6 = 113 is prime. Since 42 is the smallest number to produce a prime, a(6) = 42.
MATHEMATICA
lnk[n_]:=Module[{k=0}, While[!PrimeQ[(n!-k)/n], k++]; k]; Array[lnk, 80, 3] (* Harvey P. Dale, Jan 30 2023 *)
PROG
(PARI)
a(n)=for(k=0, 10^6, s=(n!-k)/n; if(floor(s)==s, if(ispseudoprime(s), return(k))))
n=3; while(n<100, print1(a(n), ", "); n++)
CROSSREFS
KEYWORD
nonn
AUTHOR
Derek Orr, Jul 29 2014
STATUS
approved