OFFSET
1,1
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..10000
James Maynard and Brady Haran, Primes without a 7, Numberphile video (2019).
MATHEMATICA
f[i_, nn_]:=Select[Flatten[Table[FromDigits/@(Join[{i}, #]&/@Tuples[ {0, 1, 7}, n]), {n, 0, nn}]], PrimeQ]; Union[Join[f[1, 6], f[7, 6]]] (* Harvey P. Dale, Nov 19 2011 *)
Select[Prime[Range[2 10^4]], Complement[IntegerDigits[#], {0, 1, 7}]=={}&] (* Vincenzo Librandi, Jan 16 2020 *)
PROG
(PARI) a(n, list=0, L=[0, 1, 7])={for(d=1, 1e9, my(t, u=vector(d, i, 10^(d-i))~); forvec(v=vector(d, i, [1+!(L[1]||(i>1&&i<d)), #L]), ispseudoprime( t=vecextract(L, v)*u)||next; list&&print1(t", "); n--||return(t)))} \\ Syntax updated for newer PARI versions by M. F. Hasler, Jul 26 2015
(Magma) [p: p in PrimesUpTo(80000) | Intseq(p) subset {0, 1, 7}]; // Vincenzo Librandi, Jan 16 2020
CROSSREFS
KEYWORD
nonn,base
AUTHOR
M. F. Hasler, Nov 05 2011
STATUS
approved