OFFSET
1,1
LINKS
Giovanni Resta, Table of n, a(n) for n = 1..4300 (terms a(1)-a(372) from Paolo P. Lava, terms a(373)-a(700) from Vincenzo Librandi)
EXAMPLE
399617 is prime and also 3996107, 3996017, 3990617, 3909617, 3099617.
MAPLE
A215417:=proc(q)
local a, b, c, i, n, ok;
for n from 5 to q do
a:=ithprime(n); b:=0; while a>0 do b:=b+1; a:=trunc(a/10); od;
a:=ithprime(n); ok:=1;
for i from 1 to b-1 do
c:=a+9*10^i*trunc(a/10^i); if not isprime(c) then ok:=0; break; fi;
od;
if ok=1 then print(ithprime(n)); fi;
od; end:
A215417(1000);
MATHEMATICA
Select[Prime[Range[5, 200]], And@@PrimeQ[Table[FromDigits[Insert[ IntegerDigits[ #], 0, n]], {n, 2, IntegerLength[#]}]]&] (* Harvey P. Dale, Feb 23 2014 *)
PROG
(PARI) is(n)=my(v=concat([""], digits(n))); for(i=2, #v-1, v[1]=Str(v[1], v[i]); v[i]=0; if(i>2, v[i-1]=""); if(!isprime(eval(concat(v))), return(0))); isprime(n) \\ Charles R Greathouse IV, Sep 26 2012
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Paolo P. Lava, Aug 10 2012
STATUS
approved