OFFSET
1,1
COMMENTS
Terms must contain at least one prime digit (else 11 would be a term); no term contains a decimal digit 0, 5, or 7. - Michael S. Branicky, Mar 22 2024
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
EXAMPLE
12163 is a term because it is a prime number whose prime digits and nonprime digits have the same product: 2 * 3 = 1 * 1 * 6.
MATHEMATICA
Select[Prime[Range[11500]], Length[dp = Select[d = IntegerDigits[#], PrimeQ[#1] &]] > 0 && Times @@ dp == Times @@ Select[d, !PrimeQ[#1] &] &] (* Amiram Eldar, Mar 22 2024 *)
PROG
(Python)
from math import prod
from sympy import isprime
def ok(n):
if not isprime(n): return False
s = str(n)
p, np = [d for d in s if d in "2357"], [d for d in s if d in "014689"]
return p and prod(map(int, p)) == prod(map(int, np))
print([k for k in range(10**5) if ok(k)]) # Michael S. Branicky, Mar 22 2024
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Gonzalo MartÃnez, Mar 19 2024
STATUS
approved