OFFSET
1,1
LINKS
I. O. Angell and H. J. Godwin, On Truncatable Primes, Math. Comput. 31, 265-267, 1977.
Eric Weisstein's World of Mathematics, Prime strings
MATHEMATICA
d[n_]:=IntegerDigits[n]; ltrQ[n_]:=And@@PrimeQ[NestWhileList[FromDigits[Drop[d[#], 1]]&, n, #>9&]]; palQ[n_]:=Reverse[x=d[n]]==x; Select[Prime[Range[550000]], palQ[#]&<rQ[#]&] (* Jayanta Basu, Jun 02 2013 *)
PROG
(Python)
from sympy import isprime
from itertools import count, islice
def agen(verbose=False):
prime_strings, alst = {"3", "7"}, []
yield from [2, 3, 5, 7]
for digs in count(2):
new_prime_strings = set()
for p in prime_strings:
for d in "123456789":
ts = d + "0"*(digs-1-len(p)) + p
if isprime(int(ts)):
new_prime_strings.add(ts)
prime_strings |= new_prime_strings
pals = [int(s) for s in new_prime_strings if s == s[::-1]]
yield from sorted(pals)
if verbose: print("...", digs, len(prime_strings), time()-time0)
print(list(islice(agen(), 20))) # Michael S. Branicky, Apr 04 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
G. L. Honaker, Jr. and Patrick De Geest, Nov 15 1999
EXTENSIONS
Inserted missing 31013 by Jayanta Basu, Jun 02 2013
a(27)-a(29) from Michael S. Branicky, Apr 04 2022
STATUS
approved