login
A078729
a(n) = the least positive integer k such that (k+1)(k+2)...(k+n) + 1 is prime, if such k exists; otherwise, = 0.
0
1, 1, 2, 0, 2, 2, 3, 3, 5, 1, 2, 9, 4, 2, 8, 5, 5, 3, 4, 7, 5, 6, 18, 24, 10, 1, 11, 2, 8, 22, 6, 6, 38, 4, 6, 1, 13, 4, 77, 1, 2, 14, 18, 11, 16, 5, 2, 13, 7, 20, 22, 16, 13, 39, 15, 5, 7, 12, 14, 4, 14, 81, 45, 50, 38, 42, 5, 10, 60, 56, 15, 1, 45, 25, 53, 1, 23, 12, 3, 61, 30, 68, 26, 154
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
Sequence in context: A022830 A035663 A117192 * A300236 A238158 A029906
KEYWORD
nonn
AUTHOR
Joseph L. Pe, Jan 08 2003
EXTENSIONS
More terms from Benoit Cloitre, Jan 16 2003
STATUS
approved