login
Primes p such that p and p+2 are twin primes and also the strings 987654321p and 987654321p+2 are twin primes.
0

%I #9 Oct 05 2013 08:51:46

%S 569,1019,2267,2801,3917,5879,8231,8999,18917,19139,25301,26111,27281,

%T 30089,40127,42071,43319,53279,55337,57527,75539,80747,84317,103991,

%U 106961,117701,149519,154157,154871,156491,159347,160709,201827,208589

%N Primes p such that p and p+2 are twin primes and also the strings 987654321p and 987654321p+2 are twin primes.

%e 569 and 571 are twin primes, also 987654321569 and 987654321571 are twin primes.

%t fQ[n_] := Block[{p = IntegerDigits[n], q = IntegerDigits[n + 2], r = {9, 8, 7, 6, 5, 4, 3, 2, 1}}, If[ PrimeQ[n + 2] && PrimeQ[ FromDigits[ Join[r, p]]] && PrimeQ[ FromDigits[ Join[r, q]]], True, False]]; Select[ Prime[ Range[ 19400]], fQ[ # ] &] (* _Robert G. Wilson v_, Mar 30 2005 *)

%K nonn,base

%O 1,1

%A _Zak Seidov_, Mar 30 2005

%E More terms from _Robert G. Wilson v_, Mar 30 2005