login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A052024 Every suffix of palindromic prime a(n) is prime (left-truncatable). 11
2, 3, 5, 7, 313, 353, 373, 383, 797, 30103, 31013, 70607, 73037, 76367, 79397, 3002003, 7096907, 7693967, 700090007, 799636997, 70060906007, 3000002000003, 7030000000307, 300000020000003, 300001030100003, 310000060000013, 38000000000000000000083, 30000000004000300040000000003, 3000001000000000000000000000001000003 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
I. O. Angell and H. J. Godwin, On Truncatable Primes, Math. Comput. 31, 265-267, 1977.
C. K. Caldwell, Left and Right truncatable primes.
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[#]&&ltrQ[#]&] (* 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
Sequence in context: A090719 A088297 A180015 * A052023 A052025 A359491
KEYWORD
nonn,base
AUTHOR
EXTENSIONS
Inserted missing 31013 by Jayanta Basu, Jun 02 2013
a(27)-a(29) from Michael S. Branicky, Apr 04 2022
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 16 00:00 EDT 2024. Contains 371696 sequences. (Running on oeis4.)