OFFSET
1,1
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
MATHEMATICA
a[p_] := With[{dg = IntegerDigits@p}, PrimeQ@p && OrderedQ@dg && AllTrue[dg, PrimeQ] && PrimeQ@ Total@dg]; Cases[ Range[3*10^7], _?(a@# &)] (* or *)
upToDigitLen[k_] := Cases[ FromDigits@# & /@ Select[ Flatten[ Table[ Tuples[{2, 3, 5, 7}, {i}], {i, k}], 1], OrderedQ[#] &], _?(PrimeQ@# && PrimeQ@ Total@ IntegerDigits@# &)]; upToDigitLen[10]
PROG
(Python)
from sympy import isprime
from sympy.utilities.iterables import multiset_combinations
def aupton(terms):
n, digits, alst = 0, 1, []
while len(alst) < terms:
mcstr = "".join(d*digits for d in "2357")
for mc in multiset_combinations(mcstr, digits):
sd = sum(int(d) for d in mc)
if not isprime(sd): continue
t = int("".join(mc))
if isprime(t): alst.append(t)
if len(alst) == terms: break
else: digits += 1
return alst
print(aupton(35)) # Michael S. Branicky, May 01 2021
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Mikk Heidemaa, May 01 2021
EXTENSIONS
a(33) and beyond from Michael S. Branicky, May 01 2021
STATUS
approved