OFFSET
0,2
COMMENTS
Smallest k such that n is the smallest number for which k*(k+1)*(k+2)...(k+n) + 1 is prime.
a(3) = 0 since 3 is not a term of A087565 because k*(k+1)*(k+2)*(k+3) + 1 is a square for every k.
EXAMPLE
a(1) = 3 since 1+1 is prime, 2+1 is prime, 3+1 is composite, 3*(3+1)+1 = 13 is prime.
PROG
(PARI) {p=55; a=2500; v=vector(p+1); for(n=1, a, k=0; m=n; while(!isprime(m+1, 1)&& k<=p+1, k++; m=m*(n+k)); if(k<=p, if(v[k+1]<1, v[k+1]=n))); for(j=1, p+1, print1(v[j], ", "))}
CROSSREFS
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Sep 15 2003
EXTENSIONS
Edited and extended by Klaus Brockhaus, Sep 20 2003
STATUS
approved