OFFSET
1,1
COMMENTS
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
MAPLE
M:= 7: # for terms with <+ M digits
R:= NULL:
for d from 1 to M do
S:= NULL:
for x2 from 0 to d do
for x3 from 0 to d-x2 do
for x5 from 0 to d-x2-x3 do
x7:= d-x2-x3-x5;
x:= parse(cat(2$x2, 3$x3, 5$x5, 7$x7));
if isprime(x) then S:= S, x fi;
od od od;
R:= R, op(sort([S]));
od:
R; # Robert Israel, Jul 04 2023
MATHEMATICA
Select[Prime[Range[31000]], AllTrue[d = IntegerDigits[#], PrimeQ] && LessEqual @@ d &] (* Amiram Eldar, Jul 07 2023 *)
PROG
(Python)
from sympy import isprime
from itertools import count, combinations_with_replacement as cwr, islice
def agen(): yield from (filter(isprime, (int("".join(c)) for d in count(1) for c in cwr("2357", d))))
print(list(islice(agen(), 50))) # Michael S. Branicky, Jul 05 2023
(PARI) isok(p) = if (isprime(p), my(d=digits(p)); (d == vecsort(d)) && (#select(isprime, d) == #d)); \\ Michel Marcus, Jul 07 2023
CROSSREFS
KEYWORD
nonn,base
AUTHOR
James C. McMahon, Jul 03 2023
STATUS
approved