OFFSET
1,1
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
MAPLE
N:= 4: # to produce all terms with <= N digits
ZLO:= proc(d) # produce set of d-digit odd zeroless numbers
option remember;
if d = 1 then {1, 3, 5, 7, 9}
else
map(t -> seq(t+x*10^(d-1), x=1..9), ZLO(d-1))
fi
end proc:
addzeros:= proc(x, d) # d-digit numbers formed by inserting 0's into x
local L, n, R;
L:= convert(x, base, 10);
n:= nops(L);
R:= map(t -> [op(t), d], combinat[choose](d-1, n-1));
seq(add(L[i]*10^(r[i]-1), i=1..n), r = R);
end proc:
Z[1]:= {2, 3, 5, 7}:
for i from 2 to N-1 do Z[i]:= select(isprime, ZLO(i)) od:
`union`(seq(seq(map(addzeros, Z[i], d), i=1..d-1), d=2..N));
# if using Maple 11 or earlier, uncomment the next line
# sort(convert(%, list)); # Robert Israel, Mar 19 2015
MATHEMATICA
ss={}; Do[id=IntegerDigits[p]; If[Min[id]<1&&PrimeQ[FromDigits[Delete[id, Position[id, 0]]]], ss={ss, p}], {p, 20, 2000}]; Flatten[ss]
Select[Range[1200], DigitCount[#, 10, 0]>0&&PrimeQ[FromDigits[DeleteCases[ IntegerDigits[ #], 0]]]&] (* Harvey P. Dale, Jan 01 2024 *)
PROG
(PARI) is(n)=my(d=digits(n), e=select(x->x, d)); #e<#d && isprime(fromdigits(e)) \\ Charles R Greathouse IV, Mar 19 2015
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Charles R Greathouse IV and Zak Seidov, Mar 19 2015
STATUS
approved