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!)
A217046 Primes that remain prime when a single "6" digit is inserted between any two adjacent decimal digits. 4

%I #19 Mar 08 2024 11:58:59

%S 13,17,23,29,37,41,43,47,53,59,61,71,79,83,97,101,109,113,137,157,163,

%T 167,263,277,293,307,313,317,331,397,421,443,457,463,569,607,653,659,

%U 661,673,691,739,769,787,809,823,829,863,881,977,997,1063,1087,1453

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

%H Harvey P. Dale, <a href="/A217046/b217046.txt">Table of n, a(n) for n = 1..500</a> (First 262 terms from Paolo P. Lava)

%e 185917 is prime and also 1859167, 1859617, 1856917, 1865917 and 1685917.

%p with(numtheory);

%p A217044:=proc(q,x)

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

%p for n from 5 to q do

%p a:=ithprime(n); b:=0;

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

%p for i from 1 to b-1 do

%p c:=a+9*10^i*trunc(a/10^i)+10^i*x;

%p if not isprime(c) then ok:=0; break; fi; od;

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

%p od; end:

%p A217044(100000,6)

%t Select[Prime[Range[5,1200]],And@@PrimeQ[FromDigits/@Table[ Insert[ IntegerDigits[ #],6,i],{i,2,IntegerLength[#]}]]&] (* _Harvey P. Dale_, Oct 09 2012 *)

%o (PARI) is(n)=my(v=concat([""], digits(n))); for(i=2, #v-1, v[1]=Str(v[1], v[i]); v[i]=6; if(i>2, v[i-1]=""); if(!isprime(eval(concat(v))), return(0))); isprime(n) \\ _Charles R Greathouse IV_, Sep 26 2012

%Y Cf. A050674, A050711-A050719, A069246, A159236, A215417, A215419-A215421, A217044, A217045, A217047, A217062-A217065

%K nonn,base

%O 1,1

%A _Paolo P. Lava_, Sep 25 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 19 19:02 EDT 2024. Contains 371798 sequences. (Running on oeis4.)