Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #17 Feb 07 2023 14:14:01
%S 0,99,14,1,2,73,33,10,137,277856,1
%N a(n) = minimal nonnegative k such that prime(n) * prime(n+1) * ... * prime(n+k) + 1 is divisible by prime(n+k+1), or -1 if no such k exists.
%C Assuming a(12) exists it is greater than 2.25 million.
%e a(1) = 0 as prime(1) + 1 = 2 + 1 = 3, which is divisible by prime(2) = 3.
%e a(3) = 14 as prime(3) * ... * prime(17) + 1 = 320460058359035439846, which is divisible by prime(18) = 61.
%e a(10) = 277856 as prime(10) * ... * prime(277866) + 1 = 645399...451368 (a number with 1701172 digits), which is divisible by prime(277867) = 3919259.
%e a(11) = 1 as prime(11) * prime(12) + 1 = 31 * 37 + 1 = 1148, which is divisible by prime(13) = 41.
%o (Python)
%o from sympy import prime, nextprime
%o def A360376(n):
%o p = prime(n)
%o s, k = p, 0
%o while (s+1)%(p:=nextprime(p)):
%o k += 1
%o s *= p
%o return k # _Chai Wah Wu_, Feb 07 2023
%Y Cf. A360406, A360297, A000040, A007504, A332542, A332580.
%K nonn,more
%O 1,2
%A _Scott R. Shannon_, Feb 04 2023