|
|
A061247
|
|
Prime numbers with every digit a perfect cube, i.e., consisting of only digits 0, 1 and 8.
|
|
11
|
|
|
11, 101, 181, 811, 881, 1181, 1801, 1811, 8011, 8081, 8101, 8111, 10111, 10181, 11801, 18181, 80111, 81001, 81101, 81181, 88001, 88801, 88811, 100801, 100811, 101081, 101111, 108011, 108881, 110881, 118081, 118801, 180001, 180181, 180811
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
|
|
LINKS
|
|
|
EXAMPLE
|
a(6) = 1801, 1801 is a prime and consists of only 1, 8 and 0.
|
|
MAPLE
|
N:= 1000: # to get the first N entries
count:= 0:
allowed:= {0, 1, 8}:
nallowed:= nops(allowed):
subst:= seq(i=allowed[i+1], i=0..nallowed-1);
for d from 1 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:
|
|
MATHEMATICA
|
Select[Prime[Range[50000]], Length[Union[{0, 1, 8}, IntegerDigits[ # ]]] == 3&] (* Stefan Steinerberger, Jun 10 2007 *)
Select[FromDigits/@Tuples[{0, 1, 8}, 6], PrimeQ] (* Harvey P. Dale, Jan 12 2016 *)
|
|
PROG
|
(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
(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
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,less
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|