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”).
%I #12 Mar 24 2023 16:56:10
%S 13,19,31,37,79,103,109,151,157,181,193,331,337,353,359,367,373,379,
%T 383,751,757,787,919,941,947,953,967,971,983,1009,1021,1033,1039,1063,
%U 1069,1117,1201,1249,1279,1291,1459,1483,1489,1567,1579,1597,1609,1663,1669
%N Prime such that concatenation of it and its first digit is prime.
%C Indices of primes in A085412; primes as concatenation of prime and its first digit in A085414.
%H Robert Israel, <a href="/A085413/b085413.txt">Table of n, a(n) for n = 1..10000</a>
%F Prime[A085412]
%e 13 is a term because concatenation of 13 and 1 is prime.
%p R:= NULL: count:= 0:
%p for d from 1 while count < 100 do
%p for a in [1,3,7,9] do
%p for x from 1 to 10^d-1 by 2 while count < 100 do
%p if isprime(a*10^d + x) and isprime(a*10^(d+1)+10*x+a) then
%p R:= R, a*10^d+x; count:= count+1
%p fi od od od:
%p R; # _Robert Israel_, Mar 24 2023
%o (Python)
%o from itertools import count, islice
%o from sympy import isprime, primerange
%o def agen(): # generator of terms
%o for d in count(1):
%o for f in [1, 3, 7, 9]:
%o for p in primerange(f*10**d, (f+1)*10**d):
%o if isprime(10*p+f):
%o yield p
%o print(list(islice(agen(), 50))) # _Michael S. Branicky_, Mar 24 2023
%Y Cf. A085412, A085414.
%K nonn,base
%O 1,1
%A _Zak Seidov_, Jun 29 2003