login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

A300750
a(n) is the least positive k such that prime(n) divides (prime(n+1)*prime(n+2)*...*prime(n+k))+1.
0
1, 1, 6, 5, 15, 5, 12, 14, 59, 27, 28, 31, 55, 20, 27, 141, 23, 2, 16, 69, 34, 112, 206, 32, 20, 16, 58, 121, 39, 11, 65, 342, 87, 92, 121, 134, 17, 316, 119, 3, 115, 128, 378, 62, 30, 282, 509, 106, 267, 372, 4, 586, 123, 218, 551, 218, 236, 612, 480, 61, 11, 190, 497, 314, 304, 104, 47, 209, 271, 319, 20, 292, 224
OFFSET
1,3
LINKS
Caldwell and Honaker, 89051, Prime Curios!
Eric Weisstein's World of Mathematics, Honaker's Problem
EXAMPLE
a(18) = 2 because the 18th prime (61) divides (67*71+1). Only the next 2 primes after 61 are required.
MATHEMATICA
Table[Block[{p = Prime@ n, k = 1}, While[Mod[1 + Times @@ Prime@ Range[n + 1, n + k], p] != 0, k++]; k], {n, 74}] (* Michael De Vlieger, Mar 13 2018 *)
PROG
(PARI) a(n) = my (p=prime(n), x=Mod(1, p), k=0); forprime(q=p+1, oo, x*=q; k++; if (x+1==0, return (k))) \\ Rémy Sigrist, Mar 12 2018
CROSSREFS
Cf. A000040.
Sequence in context: A120114 A123168 A119636 * A101493 A347276 A188067
KEYWORD
nonn
AUTHOR
G. L. Honaker, Jr., Mar 11 2018
EXTENSIONS
a(19)-a(73) from Chuck Gaydos
STATUS
approved