OFFSET
1,1
COMMENTS
Numbers m such that for some x, the concatenation (m+x)||m is prime, and for every j < x there is some k < m such that (k+j)||k is prime.
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..28
EXAMPLE
MAPLE
tcat:= proc(a, b) a*10^(1+ilog10(b))+b end proc:
f:= proc(n) local k, d;
for d from 1 do
if igcd(n, 10^d+1) > 1 then next fi;
for k from 10^(d-1)+`if`(d=1, 0, 1) to 10^d by 2 do
if isprime(tcat(n+k, k)) then return k fi
od od
end proc:
R:= NULL: m:= 0:
for n from 1 to 10^6 do
v:= f(n);
if v > m then m:= v; R:= R, m fi
od:
R;
PROG
(Python)
from itertools import count, islice
from math import gcd
from sympy import isprime
def A376220_gen(): # generator of terms
c = 0
for n in count(1):
for l in count(1):
if gcd(n, (m:=10**l)+1)==1:
r = m//10
a = m*(n+r)+r
for k in range(r, m):
if isprime(a):
if k>c:
yield k
c = k
break
a += m+1
else:
continue
break
CROSSREFS
KEYWORD
nonn,base,more
AUTHOR
Robert Israel, Sep 16 2024
STATUS
approved