A243886 Primes p = prime(n): such that p.n and n.p both are prime, where (.) indicates concatenation.
661, 1051, 1999, 2179, 3433, 3593, 3719, 4073, 4591, 4733, 5449, 5503, 6079, 6481, 7109, 7211, 7489, 8293, 8513, 9901, 10273, 10529, 11821, 12721, 14107, 14591, 14879, 15263, 15877, 18149, 19559, 22027, 22129, 22571, 23339, 24527, 25357, 26881, 27337, 34259
Offset: 1
Examples
661 is in the sequence because 661 = prime(121): Concatenations of [661.121 = 661121] and concatenation of [121.661 = 121661] which are also primes. 1051 is in the sequence because 1051 = prime(177): Concatenation of [1051.177 = 1051177] and concatenation of [177.1051 = 1771051] which are also primes.
Links
- K. D. Bajpai, Table of n, a(n) for n = 1..10000
Programs
-
Maple
with(numtheory): with(StringTools): A243886:= proc() local p,k1,k2; p:=ithprime(n); k1:=parse (cat (p,n)); k2:=parse(cat(n,p)); if isprime(k1)and isprime(k2) then RETURN (p); fi; end: seq(A243886 (), n=1..5000);
-
Mathematica
Select[Prime [Range[5000]], PrimeQ[FromDigits[Join[IntegerDigits [PrimePi [#]], IntegerDigits [#]]]] && PrimeQ [FromDigits [Join [IntegerDigits[#], IntegerDigits [PrimePi [#]]]]] &]
Comments