cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A360406 a(n) = minimal positive 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.

This page as a plain text file.
%I A360406 #17 Feb 22 2023 08:08:29
%S A360406 1,1,9,14,31,826,1,34
%N A360406 a(n) = minimal positive 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 A360406 Assuming a(9) exists it is greater than 1.75 million.
%C A360406 a(11) = 692, a(12) = 8, a(13) = 792. - _Robert Israel_, Feb 22 2023
%e A360406 a(1) = 1 as prime(1) * prime(2) - 1 = 2 * 3 - 1 = 5, which is divisible by prime(3) = 5.
%e A360406 a(2) = 1 as prime(2) * prime(3) - 1 = 3 * 5 - 1 = 14, which is divisible by prime(4) = 7.
%e A360406 a(3) = 9 as prime(3) * ... * prime(12) - 1 = 1236789689134, which is divisible by prime(13) = 41.
%p A360406 f:= proc(n) local P,k,p;
%p A360406 P:= ithprime(n); p:= nextprime(P);
%p A360406 for k from 0 to 10^6 do
%p A360406   if P-1 mod p = 0 then return k fi;
%p A360406   p:= nextprime(p);
%p A360406  od;
%p A360406 FAIL
%p A360406 end proc:
%p A360406 map(f, [$1..8]); # _Robert Israel_, Feb 22 2023
%o A360406 (Python)
%o A360406 from sympy import prime, nextprime
%o A360406 def A360406(n):
%o A360406     p = prime(n)
%o A360406     q = nextprime(p)
%o A360406     s, k = p*q, 1
%o A360406     while (s-1)%(q:=nextprime(q)):
%o A360406         k += 1
%o A360406         s *= q
%o A360406     return k # _Chai Wah Wu_, Feb 06 2023
%Y A360406 Cf. A360376, A360297, A000040, A007504, A332542, A332580.
%K A360406 nonn,more
%O A360406 1,3
%A A360406 _Scott R. Shannon_, Feb 06 2023