login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A215417 Primes that remain prime when a single zero digit is inserted between any two adjacent digits. 30

%I #31 May 21 2018 03:30:03

%S 11,13,17,19,37,41,53,59,61,67,71,79,89,97,109,113,131,149,191,197,

%T 227,239,269,281,283,337,367,379,383,401,421,449,457,499,503,509,587,

%U 607,673,701,719,727,739,757,809,811,887,907,929,991,1009,1061,1093,1103

%N Primes that remain prime when a single zero digit is inserted between any two adjacent digits.

%H Giovanni Resta, <a href="/A215417/b215417.txt">Table of n, a(n) for n = 1..4300</a> (terms a(1)-a(372) from Paolo P. Lava, terms a(373)-a(700) from Vincenzo Librandi)

%e 399617 is prime and also 3996107, 3996017, 3990617, 3909617, 3099617.

%p A215417:=proc(q)

%p local a,b,c,i,n,ok;

%p for n from 5 to q do

%p a:=ithprime(n); b:=0; while a>0 do b:=b+1; a:=trunc(a/10); od;

%p a:=ithprime(n);ok:=1;

%p for i from 1 to b-1 do

%p c:=a+9*10^i*trunc(a/10^i); if not isprime(c) then ok:=0; break; fi;

%p od;

%p if ok=1 then print(ithprime(n)); fi;

%p od; end:

%p A215417(1000);

%t Select[Prime[Range[5,200]],And@@PrimeQ[Table[FromDigits[Insert[ IntegerDigits[ #],0,n]],{n,2,IntegerLength[#]}]]&] (* _Harvey P. Dale_, Feb 23 2014 *)

%o (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

%Y Cf. A159236, A069246, A215419-A215421.

%K nonn,base

%O 1,1

%A _Paolo P. Lava_, Aug 10 2012

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 18 22:18 EDT 2024. Contains 371782 sequences. (Running on oeis4.)