OFFSET
1,1
LINKS
MAPLE
N:= 10000: # to get the first N terms
count:= 0:
allowed:= {0, 1, 5}:
nallowed:= nops(allowed):
subst:= seq(i=allowed[i+1], i=0..nallowed-1):
for d from 0 while count < N do
for x1 from 1 to nallowed-1 while count < N do
for t from 0 to nallowed^d-1 while count < N do
L:= subs(subst, convert(x1*nallowed^d+t, base, nallowed));
X:= add(L[i]*10^(i-1), i=1..d+1);
if isprime(X) then
count:= count+1;
A[count]:= X;
fi
od od od:
seq(A[n], n=1..N); # Robert Israel, Apr 20 2014
MATHEMATICA
Select[FromDigits/@Tuples[{0, 1, 5}, 6], PrimeQ] (* Harvey P. Dale, Jul 23 2021 *)
PROG
(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) */
(Magma) [p: p in PrimesUpTo(160000) | Set(Intseq(p)) subset [0, 1, 5]]; // Vincenzo Librandi, Apr 22 2014
CROSSREFS
KEYWORD
nonn,base
AUTHOR
M. F. Hasler, Nov 05 2011
STATUS
approved