cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A217065 Primes that remain prime when a single "7" digit is inserted between any two adjacent digits.

This page as a plain text file.
%I A217065 #16 Jul 30 2025 09:46:06
%S A217065 13,19,67,73,97,277,367,379,421,433,487,541,691,757,853,967,1117,1471,
%T A217065 1747,2017,2617,2749,2851,2953,3463,3529,3571,4507,5077,5923,6073,
%U A217065 6079,6343,6481,6577,6709,6829,6967,7351,7417,7573,7681,8317,8719,9157,9649,13177
%N A217065 Primes that remain prime when a single "7" digit is inserted between any two adjacent digits.
%H A217065 Harvey P. Dale, <a href="/A217065/b217065.txt">Table of n, a(n) for n = 1..422</a> (First 118 terms from Paolo P. Lava)
%e A217065 311683 is prime and also 3116873, 3116783, 3117683, 3171683 and 3711683.
%p A217065 with(numtheory);
%p A217065 A217065:=proc(q,x)
%p A217065 local a,b,c,i,n,ok;
%p A217065 for n from 5 to q do
%p A217065   a:=ithprime(n); b:=0; while a>0 do b:=b+1; a:=trunc(a/10); od; a:=ithprime(n); ok:=1;
%p A217065     for i from 1 to b-1 do
%p A217065       c:=a+9*10^i*trunc(a/10^i)+10^i*x;  if not isprime(c) then ok:=0; break; fi; od;
%p A217065     if ok=1 then print(ithprime(n)); fi; od; end:
%p A217065 A217065(1000000,7);
%t A217065 Select[Prime[Range[5,1600]],AllTrue[FromDigits/@Table[Insert[ IntegerDigits[ #],7,i],{i,2,IntegerLength[#]}],PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* _Harvey P. Dale_, Oct 12 2016 *)
%o A217065 (PARI) is(n)=my(v=concat([""], digits(n))); for(i=2, #v-1, v[1]=Str(v[1], v[i]); v[i]=7; if(i>2, v[i-1]=""); if(!isprime(eval(concat(v))), return(0))); isprime(n) \\ _Charles R Greathouse IV_, Sep 26 2012
%Y A217065 Cf. A050674, A050711-A050719, A069246, A159236, A215417, A215419-A215421, A217044-A217047, A217062-A217064.
%K A217065 nonn,base
%O A217065 1,1
%A A217065 _Paolo P. Lava_, Sep 26 2012