A384958 a(n) is the first prime p such that the concatenations of n consecutive primes, starting with p, in both forward and backward directions, are prime.
2, 199, 313, 139, 67, 113, 163, 1583, 23789, 941, 131, 5351, 26801, 2693, 4073, 15859, 4919, 23209, 176053, 86783, 29717, 20849, 151289, 50111, 51971, 23689, 11807, 180337, 563, 25153, 517381, 36313, 256121, 753091, 208441, 28573, 4049, 108943, 451361, 114343, 28447, 21001, 4001, 3137, 6833, 885919
Offset: 1
Examples
a(4) = 139 because the four consecutive primes starting with 139 are 139, 149, 151, 157, both 139149151157 and 157151149139 are prime, and no smaller prime works.
Links
- Robert Israel, Table of n, a(n) for n = 1..135
Crossrefs
Cf. A384953.
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: f:= proc(n) local L,i; L:= [0,seq(ithprime(i),i=1..n-1)]; do L:= [op(L[2..-1]),nextprime(L[-1])]; if isprime(fcat(L)) and isprime(rcat(L)) then return L[1] fi od end proc: map(f, [$1..50]);