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.
%I A338567 #34 Nov 10 2024 05:08:01 %S A338567 3,5,7,13,19,23,31,89,199 %N A338567 Primes p such that (q*r) mod p is prime, where q and r are the next primes after p. %C A338567 a(10) > 2*10^10 if it exists. - _Michael S. Branicky_, Mar 05 2021 %C A338567 From _Jason Yuen_, Jun 11 2024: (Start) %C A338567 All terms satisfy (q-p)*(r-p) > p. %C A338567 Data from A002386 and A005250 show that a(10) > 18361375334787046697 if it exists. (End) %C A338567 Note that q*r == (q-p)*(r-p) (mod p). As soon as the prime gap grows slow enough, for all large enough p we have (q*r) mod p = (q-p)*(r-p), which is composite, implying finiteness of this sequence. In particular, finiteness would follow from Cramer's conjecture. - _Max Alekseyev_, Nov 09 2024 %e A338567 a(4)=13 is in the sequence because it is prime, the next two primes are 17 and 19, and (17*19) mod 13 = 11, which is prime. %p A338567 R:= NULL: q:= 2: r:= 3: %p A338567 count:= 0: %p A338567 for i from 1 to 10000 do %p A338567 p:= q; q:= r; r:= nextprime(r); %p A338567 if isprime(q*r mod p) then count:= count+1; R:= R, p fi %p A338567 od: %p A338567 R; %o A338567 (Python) %o A338567 from sympy import nextprime, isprime %o A338567 def afind(limit): %o A338567 p, q, r = 1, 2, 3 %o A338567 while p < limit: %o A338567 p, q, r = q, r, nextprime(r) %o A338567 if isprime(q*r % p): print(p, end=", ") %o A338567 afind(200) # _Michael S. Branicky_, Mar 05 2021 %Y A338567 Cf. A338566, A338570. Contained in A338577. %Y A338567 Cf. A002386, A005250. %K A338567 nonn,more,hard %O A338567 1,1 %A A338567 _J. M. Bergot_ and _Robert Israel_, Nov 02 2020