OFFSET
0,1
COMMENTS
For every 5-digit prime p, there are at least 70 primes q. Thus it is very likely that a(n) = 0 for 38 <= n <= 69. However, there is no proof of this.
EXAMPLE
a(4) = 19 because 19 is prime and there are 4 primes 13, 31, 79, 97 where 1913, 1319, 1931, 3119, 1979, 7931, 1397 and 9731 are prime, and no smaller prime works.
MAPLE
A:= Array(0..37): count:= 0: p:= 0:
while count < 38 do
p:= nextprime(p);
v:= f(p);
if v <= 37 and A[v] = 0 then count:= count+1; A[v]:= p; fi;
od:
convert(A, list);
PROG
(Python)
from itertools import count, islice
from sympy import isprime, primerange
def agen(): # generator of terms
adict, n = dict(), 0
for d in count(1):
pow = 10**d
for p in primerange(10**(d-1), pow):
v = 0
for q in primerange(10**(d-1), pow):
t = p*pow + q
if isprime(p*pow + q) and isprime(q*pow + p): v += 1
if v not in adict: adict[v] = p
while n in adict: yield adict[n]; n += 1
print(list(islice(agen(), 38))) # Michael S. Branicky, Nov 15 2022
CROSSREFS
KEYWORD
nonn,base,more
AUTHOR
J. M. Bergot and Robert Israel, Nov 15 2022
STATUS
approved