OFFSET
1,1
COMMENTS
Subsequence of A019546.
EXAMPLE
2777 is in this sequence because it is prime, all its digits are prime and 2777 in base 9 is 3725, whose digits are all prime.
MATHEMATICA
Select[Range[2.1*10^7], PrimeQ[#]&&AllTrue[IntegerDigits[#], PrimeQ]&&AllTrue[IntegerDigits[#, 9], PrimeQ]&] (* or *)
seq1[dignum_, b_] := Module[{s = {}}, Do[s = Join[s, Select[FromDigits[#, b] & /@ Tuples[{2, 3, 5, 7}, k], PrimeQ]], {k, 1, dignum}]; s]; seq[maxdig9_] := Select[Intersection[seq1[maxdig9, 9], seq1[maxdig9, 10]], # <= 9^maxdig9 &]; seq[11] (* Amiram Eldar, Jan 06 2024 *)
PROG
(Python)
from gmpy2 import digits, is_prime
from itertools import count, islice, product
def bgen():
yield from [2, 3, 5, 7]
for d in count(2):
for f in product("2357", repeat=d-1):
for last in "37":
yield int("".join(f)+last)
def agen(): yield from (t for t in bgen() if is_prime(t) and set(digits(t, 9)) <= set("2357"))
print(list(islice(agen(), 33))) # Michael S. Branicky, Jan 07 2024
CROSSREFS
KEYWORD
nonn,base
AUTHOR
James C. McMahon, Jan 06 2024
STATUS
approved