OFFSET
1,1
LINKS
Pierre CAMI, Table of n, a(n) for n = 1..10000
EXAMPLE
393 is composite.
595 is composite.
797 is prime so a(1)=7.
11911 is composite.
13913 is prime so a(2)=13.
MATHEMATICA
Select[Prime[Range[200]], PrimeQ[FromDigits[Join[IntegerDigits[#], {9}, IntegerDigits[ #]]]]&] (* Harvey P. Dale, Jul 25 2015 *)
PROG
(PARI) lista(nn) = {forprime(p=1, nn, if (isprime(eval(concat(concat(Str(p), 9), Str(p)))), print1(p, ", ")); ); } \\ Michel Marcus, Oct 27 2014
(Magma) [p: p in PrimesUpTo(3000) | IsPrime(Seqint(Intseq(p) cat [9] cat Intseq(p)))]; // Vincenzo Librandi, Oct 27 2014
(Python)
from sympy import isprime, primerange
def ok(p): swb = str(p); return isprime(int(swb + '9' + swb))
def aupto(lim): return [p for p in primerange(1, lim+1) if ok(p)]
print(aupto(1260)) # Michael S. Branicky, Jul 13 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Pierre CAMI, Oct 27 2014
STATUS
approved