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!)
A271438 Numbers n such that the number formed by concatenating in ascending order the first n multidigit palindromic primes is prime. 0
1, 17, 451 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
G. L. Honaker, Jr. and C. Caldwell, 11101...10301 (52-digits), Prime Curios!.
EXAMPLE
Concatenating in ascending order the 17 smallest palindromic primes with at least two digits gives 1110113115118119131335337338372775778779791992910301, which is prime, so 17 is a term of the sequence.
PROG
(PARI) nextpalprime(n) = my(p=nextprime(n)); while(p!=eval(concat(Vecrev(Str(p)))), p=nextprime(p+1)); p
terms(n) = my(i=0, k=1, s="", p=10); while(i < n, p=nextpalprime(p+1); s=Str(s, p); if(ispseudoprime(eval(s)), print1(k, ", "); i++); k++)
terms(3) \\ print initial three terms
(Python)
from sympy import isprime, nextprime
def ispal(n): strn = str(n); return strn == strn[::-1]
def agen():
np, p, pstr = 1, 11, "11"
while True:
if isprime(int(pstr)): yield np
p = nextprime(p)
while not ispal(p): p = nextprime(p)
np += 1
pstr += str(p)
for an in agen(): print(an, end=", ") # Michael S. Branicky, Jan 17 2021
CROSSREFS
Cf. A002385.
Sequence in context: A301642 A035022 A012117 * A122430 A009051 A035276
KEYWORD
nonn,base,more,bref
AUTHOR
Felix Fröhlich, Apr 07 2016
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 23 18:16 EDT 2024. Contains 371916 sequences. (Running on oeis4.)