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.
%I A199325 #25 Jul 14 2025 17:25:13 %S A199325 5,11,101,151,1051,1151,1511,5011,5051,5101,5501,10111,10151,10501, %T A199325 11551,15101,15511,15551,50051,50101,50111,50551,51001,51151,51511, %U A199325 51551,55001,55051,55501,55511,100151,100501,100511,101051,101111,101501,110051,110501,115001,115151,150001,150011,150151,150551 %N A199325 Primes having only {0, 1, 5} as digits. %H A199325 Robert Israel, <a href="/A199325/b199325.txt">Table of n, a(n) for n = 1..10000</a> %H A199325 <a href="/index/Pri#PrimesWithDigits">Index to entries about primes with digits in a given set</a> %p A199325 N:= 10000: # to get the first N terms %p A199325 count:= 0: %p A199325 allowed:= {0,1,5}: %p A199325 nallowed:= nops(allowed): %p A199325 subst:= seq(i=allowed[i+1],i=0..nallowed-1): %p A199325 for d from 0 while count < N do %p A199325 for x1 from 1 to nallowed-1 while count < N do %p A199325 for t from 0 to nallowed^d-1 while count < N do %p A199325 L:= subs(subst,convert(x1*nallowed^d+t,base,nallowed)); %p A199325 X:= add(L[i]*10^(i-1),i=1..d+1); %p A199325 if isprime(X) then %p A199325 count:= count+1; %p A199325 A[count]:= X; %p A199325 fi %p A199325 od od od: %p A199325 seq(A[n],n=1..N); # _Robert Israel_, Apr 20 2014 %t A199325 Select[FromDigits/@Tuples[{0,1,5},6],PrimeQ] (* _Harvey P. Dale_, Jul 23 2021 *) %o A199325 (PARI) L=[0,1,5];for(d=1,6,u=vector(d,i,10^(d-i))~;forvec(v=vector(d,i,[1+(i==1 & !L[1]),#L]),ispseudoprime(t=vector(d,i,L[v[i]])*u)&print1(t","))) /* see A199327 for a function a(n) */ %o A199325 (Magma) [p: p in PrimesUpTo(160000) | Set(Intseq(p)) subset [0, 1, 5]]; // _Vincenzo Librandi_, Apr 22 2014 %Y A199325 Cf. A020449 - A020472, A199326 - A199329, A061247, A199340 - A199349. %K A199325 nonn,base %O A199325 1,1 %A A199325 _M. F. Hasler_, Nov 05 2011