OFFSET
1,1
COMMENTS
EXAMPLE
MATHEMATICA
q[n_, b_] := Max[d = IntegerDigits[n]] < b && PrimeQ[FromDigits[d, b]]; Select[Range[200000], q[#, 4] && q[#, 5] &] (* Amiram Eldar, Jan 15 2023 *)
PROG
(Python)
from sympy import isprime
def ok(n): return max(s:=str(n)) < '4' and isprime(int(s, 4)) and isprime(int(s, 5))
print([k for k in range(10**6) if ok(k)]) # Michael S. Branicky, Jan 15 2023
(Python)
from sympy import isprime
from itertools import count, islice, product
def agen(): yield from (int(s) for d in count(1) for f in "123" for r in product("0123", repeat=d-1) if isprime(int(s:=f+"".join(r), 4)) and isprime(int(s, 5)))
print(list(islice(agen(), 40))) # Michael S. Branicky, Jan 15 2023
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Bernard Schott, Jan 15 2023
EXTENSIONS
More terms from Amiram Eldar, Jan 15 2023
STATUS
approved