A384953 First of three consecutive primes whose concatenations, both forward and backward, are primes.
313, 359, 383, 449, 619, 787, 827, 907, 1697, 2503, 2521, 2857, 3673, 3853, 4139, 4363, 4993, 5281, 5527, 5563, 5641, 5851, 6037, 6043, 6719, 7019, 7477, 9281, 10177, 10459, 13799, 14009, 15013, 15511, 17167, 17209, 19183, 19423, 20483, 20743, 21397, 21407, 25111
Offset: 1
Examples
a(3) = 383 is a term because 383, 389 and 397 are consecutive primes and both 383389397 and 397389383 are prime.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
Maple
rcat:= proc(L) local x,i; x:= L[1]; for i from 2 to nops(L) do x:= 10^(1+ilog10(x))*L[i] + x od; x end proc: fcat:= proc(L) local x,i; x:= L[1]; for i from 2 to nops(L) do x:= 10^(1+ilog10(L[i]))*x + L[i] od; x end proc: P:= select(isprime,[seq(i,i=3..30000,2)]): J:= select(i -> isprime(rcat(P[i..i+2])) and isprime(fcat(P[i..i+2])), [$1..nops(P)-2]): P[J];