OFFSET
1,3
COMMENTS
(k+1)*(k+2)*(k+3)*(k+4) + 1 = (k^2 + 5*k + 5)^2, which is never prime. Hence a(4) = 0. Is this the only zero term? - Benoit Cloitre, Jan 16 2003
EXAMPLE
k=2 is the least positive integer such that (k+1)(k+2)(k+3) + 1 is prime, so a(3) = 2.
MATHEMATICA
Join[{1, 1, 2, 0}, Table[Module[{k=1}, While[!PrimeQ[Times@@(k+Range[n])+1], k++]; k], {n, 5, 90}]] (* Harvey P. Dale, Aug 27 2021 *)
PROG
(PARI) a(n) = if (n==4, 0, k=1; while(!isprime(1+prod(j=1, n, k+j)), k++); k; ); \\ Michel Marcus, Feb 15 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Joseph L. Pe, Jan 08 2003
EXTENSIONS
More terms from Benoit Cloitre, Jan 16 2003
STATUS
approved