OFFSET
1,1
COMMENTS
Each term is the second in an arithmetic progression of five primes, of which at least the second, third and fourth are consecutive primes.
LINKS
Robert Israel, Table of n, a(n) for n = 1..1000
EXAMPLE
a(3) = 3678317 is a term because it is prime, the next two primes are 3678347 and 3678377, and 3678317+3678347-3678377 = 3678287, 3678317-3678347+3678377 = 3678347, and -3678317+3678347+3678377 = 3678407 are all primes.
MAPLE
f:= proc(p, q, r)
isprime(p+q-r) and isprime(p-q+r) and isprime(-p+q+r)
end proc:
p:= 2: q:= 3: r:= 5: R:= NULL: count:= 0:
while r < 10^8 do
p:= q; q:= r; r:= nextprime(r);
if f(p, q, r) then count:= count+1; R:= R, p fi
od:
R;
PROG
(Python)
from sympy import isprime, nextprime
def c(p, q, r): return isprime(p+q-r) and isprime(p-q+r) and isprime(-p+q+r)
def afind():
p, q, r = 2, 3, 5
while True:
if c(p, q, r): print(p, end=", ")
p, q, r = q, r, nextprime(r)
afind() # Michael S. Branicky, Jan 30 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, Jan 30 2022
STATUS
approved