login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(n) is the least prime p such that there are exactly n primes q with the same number of digits as p such that the concatenations p|q and q|p are prime, or 0 if there is no such p.
0

%I #8 Nov 19 2022 20:24:40

%S 2,3,13,23,19,353,157,173,101,113,137,193,181,1831,983,1297,2861,1321,

%T 1259,1381,1229,1039,1009,1097,1033,1019,1237,1129,1051,1013,1049,

%U 1723,1181,1117,1583,1523,1153,1439

%N a(n) is the least prime p such that there are exactly n primes q with the same number of digits as p such that the concatenations p|q and q|p are prime, or 0 if there is no such p.

%C 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.

%e 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.

%p A:= Array(0..37): count:= 0: p:= 0:

%p while count < 38 do

%p p:= nextprime(p);

%p v:= f(p);

%p if v <= 37 and A[v] = 0 then count:= count+1; A[v]:= p; fi;

%p od:

%p convert(A,list);

%o (Python)

%o from itertools import count, islice

%o from sympy import isprime, primerange

%o def agen(): # generator of terms

%o adict, n = dict(), 0

%o for d in count(1):

%o pow = 10**d

%o for p in primerange(10**(d-1), pow):

%o v = 0

%o for q in primerange(10**(d-1), pow):

%o t = p*pow + q

%o if isprime(p*pow + q) and isprime(q*pow + p): v += 1

%o if v not in adict: adict[v] = p

%o while n in adict: yield adict[n]; n += 1

%o print(list(islice(agen(), 38))) # _Michael S. Branicky_, Nov 15 2022

%Y Cf. A358421.

%K nonn,base,more

%O 0,1

%A _J. M. Bergot_ and _Robert Israel_, Nov 15 2022