A225575 Primes p such that if q is the next prime after p then the concatenation of p with q and the concatenation of q with p are both primes.
199, 233, 257, 353, 523, 653, 971, 1973, 2333, 3259, 3637, 3761, 4283, 4993, 5927, 6353, 6529, 6563, 7907, 8831, 9293, 9851, 10711, 10861, 11731, 13037, 13177, 13681, 15241, 16381, 16693, 16931, 18341, 18899, 19577, 21787, 23857, 24071, 28621, 31657, 32911
Offset: 1
Examples
The prime following 199 is 211 and both 199211 and 211199 are prime.
Links
- Marius A. Burtea, Table of n, a(n) for n = 1..10000 (terms 1..250 from Paolo P. Lava)
- Carlos Rivera, Puzzle 687: 17769643, The Prime Puzzles & Problems Connection.
Crossrefs
Cf. A030459.
Programs
-
Magma
conc:=func; [p:p in PrimesUpTo(17000)| IsPrime(conc(p,(NextPrime(p)))) and IsPrime(conc(NextPrime(p),p))]; // Marius A. Burtea, Jan 25 2020
-
Maple
a:=NULL; for i from 1 to 2000 do p:=ithprime(i); q:=nextprime(p); s:=convert(p,string); t:=convert(q,string); if isprime(parse(cat(s,t))) and isprime(parse(cat(t,s))) then a:=a,p; fi; od: a;
-
Mathematica
concatQ[{a_,b_}]:=Module[{idna=IntegerDigits[a],idnb=IntegerDigits[b]},AllTrue[ FromDigits/@ {Join[idna,idnb], Join[idnb,idna]},PrimeQ]]; Transpose[Select[ Partition[ Prime[Range[2000]],2,1],concatQ]][[1]] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Jul 16 2015 *)
Comments