OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(4) = 7 is a term because 7, 11, 13 are three consecutive primes with 7*11 + 11*13 + 13*7 = 311 which is prime.
MAPLE
R:= NULL: count:= 0:
P:= Vector(3, ithprime):
while count < 100 do
x:= P[1]*P[2]+P[2]*P[3]+P[3]*P[1];
if isprime(x) then R:= R, P[1]; count:= count+1 fi;
P[1..2]:= P[2..3];
P[3]:= nextprime(P[3]);
od:
R;
MATHEMATICA
Select[Partition[Prime[Range[250]], 3, 1], PrimeQ[Total[# * RotateLeft[#]]] &][[;; , 1]] (* Amiram Eldar, Aug 08 2022 *)
PROG
(Python)
from itertools import islice
from sympy import isprime, nextprime
def agen():
p, q, r = 2, 3, 5
while True:
if isprime(p*q + q*r + r*p): yield p
p, q, r = q, r, nextprime(r)
print(list(islice(agen(), 58))) # Michael S. Branicky, Aug 08 2022
(PARI) list(lim)=my(v=List(), p=2, q=3); forprime(r=5, nextprime(nextprime(lim\1+1)+1), if(isprime(p*q + q*r + r*p), listput(v, p)); p=q; q=r); Vec(v) \\ Charles R Greathouse IV, Sep 06 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, Aug 08 2022
STATUS
approved