OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..1000
EXAMPLE
a(3) = 101293 is a term because 101293, 101, 293, (101+293)/2 = 197, 101197 and 197293 are all primes.
MAPLE
Res:= NULL: count:= 0:
for d from 2 by 2 while count < 100 do
pq:= 10^(d-1);
while count < 100 do
pq:= nextprime(pq);
if pq > 10^d then break fi;
q:= pq mod 10^(d/2);
if q < 10^(d/2-1) then next fi;
p:= (pq-q)/10^(d/2);
r:= (p+q)/2;
if not (r::integer and isprime(q) and isprime(p) and isprime(r)) then next fi;
if isprime(p*10^(d/2)+r) and isprime(r*10^(d/2)+q) then Res:= Res, pq; count:= count+1; fi
od;
od:
Res;
PROG
(Python)
from itertools import count, islice
from sympy import isprime, primerange
def agen(): # generator of terms
for d in count(1):
pow = 10**d
for p in primerange(10**(d-1), pow):
for q in primerange(10**(d-1), pow):
t = p*pow + q
if isprime(t):
r = (p+q)//2
if all(isprime(t) for t in [r, r*pow + q, p*pow + r]):
yield t
print(list(islice(agen(), 37))) # Michael S. Branicky, Nov 15 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
J. M. Bergot and Robert Israel, Nov 14 2022
STATUS
approved