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 A061247 #34 Jul 20 2025 18:07:05 %S A061247 11,101,181,811,881,1181,1801,1811,8011,8081,8101,8111,10111,10181, %T A061247 11801,18181,80111,81001,81101,81181,88001,88801,88811,100801,100811, %U A061247 101081,101111,108011,108881,110881,118081,118801,180001,180181,180811 %N A061247 Primes having only {0, 1, 8} as digits. %C A061247 The intersection with A007500 is listed in A199328. - _M. F. Hasler_, Nov 05 2011 %H A061247 Robert Israel, <a href="/A061247/b061247.txt">Table of n, a(n) for n = 1..17482</a> %e A061247 a(6) = 1801, 1801 is a prime and consists of only 1, 8 and 0. %p A061247 N:= 1000: # to get the first N entries %p A061247 count:= 0: %p A061247 allowed:= {0,1,8}: %p A061247 nallowed:= nops(allowed): %p A061247 subst:= seq(i=allowed[i+1],i=0..nallowed-1); %p A061247 for d from 1 while count < N do %p A061247 for x1 from 1 to nallowed-1 while count < N do %p A061247 for t from 0 to nallowed^d-1 while count < N do %p A061247 L:= subs(subst,convert(x1*nallowed^d+t,base,nallowed)); %p A061247 X:= add(L[i]*10^(i-1),i=1..d+1); %p A061247 if isprime(X) then %p A061247 count:= count+1; %p A061247 A[count]:= X; %p A061247 fi %p A061247 od od od: %p A061247 seq(A[n],n=1..N); # _Robert Israel_, Apr 20 2014 %t A061247 Select[Prime[Range[50000]],Length[Union[{0,1,8},IntegerDigits[ # ]]] == 3&] (* _Stefan Steinerberger_, Jun 10 2007 *) %t A061247 Select[FromDigits/@Tuples[{0,1,8},6],PrimeQ] (* _Harvey P. Dale_, Jan 12 2016 *) %o A061247 (PARI) a(n=50, L=[0, 1, 8], show=0)={my(t); for(d=1, 1e9, 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) || next; show && print1(t", "); n-- || return(t)))} \\ _M. F. Hasler_, Nov 05 2011 %o A061247 (Magma) [NthPrime(n): n in [1..2*10^4] | forall{d: d in Intseq(NthPrime(n)) | d in [0, 1, 8]}]; // _Vincenzo Librandi_, May 15 2019 %Y A061247 Cf. A061246, A020449-A020472, A199325-A199329. %K A061247 nonn,base %O A061247 1,1 %A A061247 _Amarnath Murthy_, Apr 23 2001 %E A061247 Corrected and extended by _Stefan Steinerberger_, Jun 10 2007