OFFSET
1,2
COMMENTS
Least m > 0 such that m+n! is the smallest prime of form m+k!. - Jens Kruse Andersen, Jul 30 2014
LINKS
Vaclav Kotesovec and Jens Kruse Andersen, Table of n, a(n) for n = 1..200 (first 92 terms from Vaclav Kotesovec)
EXAMPLE
a(2) = 3 since 3+2! is the smallest prime of the form 3+k!, and 3 is the least such number. While 1+2! is also prime, there is a smaller prime 1+1! in that case so a(2) is not 1. - Jens Kruse Andersen, Jul 30 2014
MATHEMATICA
nmax=2000; Table[nn=1; k=0; While[k!=n && nn<nmax, k=1; While[Not[PrimeQ[nn+k!]] && k<=nn, k++]; If[k>nn, k=0]; nn++]; If[nn==nmax, 0, nn-1], {n, 1, 10}]
PROG
(PARI)
a(n)=for(k=1, n, if(ispseudoprime(n+k!), return(k)))
b(n)=for(k=1, 10^6, if(a(k)==n, return(k)))
n=1; while(n<150, print1(b(n), ", "); n++) \\ Derek Orr, Jul 30 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
Vaclav Kotesovec, Jul 30 2014
STATUS
approved