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.

A215420 Primes that remain prime when a single digit 7 is inserted between any two consecutive digits or as the leading or trailing digit.

Original entry on oeis.org

3, 19, 97, 433, 487, 541, 691, 757, 853, 1471, 2617, 2953, 4507, 6481, 7351, 7417, 8317, 13177, 31957, 42457, 46477, 47977, 50077, 59053, 71917, 73897, 74377, 77479, 77743, 77761, 79039, 99103, 175687, 220897, 271177, 360973
Offset: 1

Views

Author

Paolo P. Lava, Aug 10 2012

Keywords

Examples

			59053 is prime as are 590537, 590573, 590753, 597053, 579053, and 759053.
		

Crossrefs

Programs

  • Maple
    A215420:=proc(q,x)
    local a,b,c,d,i,n,ok;
    for n from 1 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 0 to b do
        c:=a+9*10^i*trunc(a/10^i)+10^i*x; if not isprime(c) then ok:=0; break; fi;
      od;
      if ok=1 then print(ithprime(n)); fi;
    od; end:
    A215420(1000,7);
  • Mathematica
    Select[Prime[Range[31000]],AllTrue[FromDigits/@Table[Insert[ IntegerDigits[ #],7,n],{n,IntegerLength[#]+1}],PrimeQ]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Oct 29 2020 *)