OFFSET
1,1
LINKS
K. D. Bajpai, Table of n, a(n) for n = 1..10300
EXAMPLE
a(2) = 5347 because 5347 is 53 (a prime) concatenated with 47 (the preceding prime).
MATHEMATICA
concatpr[n_]:=FromDigits[Join[IntegerDigits[n], IntegerDigits[ NextPrime[ n, -1]]]]; Select[concatpr/@Prime[Range[400]], PrimeQ] (* Harvey P. Dale, May 12 2011 *)
PROG
(PARI) for(n=1, 10^3, p=prime(n); q=concat(Str(p), Str(precprime(p-1))); if(isprime(eval(q)), print1(q, ", "))) \\ Derek Orr, Aug 14 2014
(Python)
from itertools import islice
from sympy import isprime, nextprime
def agen(): # generator of terms
p, pstr = 2, "2"
while True:
q = nextprime(p)
qstr = str(q)
t = int(qstr + pstr)
if isprime(t):
yield t
p, pstr = q, qstr
print(list(islice(agen(), 32))) # Michael S. Branicky, Jan 05 2022
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Chuck Seggelin (barkeep(AT)plasteredDragon.com), Oct 15 2003
EXTENSIONS
Terms a(30), a(31) and a(32) added by K. D. Bajpai, Aug 14 2014
STATUS
approved