OFFSET
1,1
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
EXAMPLE
9173 is a term because it is a prime number whose prime digits and nonprime digits have the same sum: 3 + 7 = 1 + 9 = 10.
MATHEMATICA
Select[Prime[Range[1200]], Plus @@ Select[d = IntegerDigits[#], PrimeQ[#1] &] == Plus @@ Select[d, ! PrimeQ[#1] &] &] (* Amiram Eldar, Mar 22 2024 *)
PROG
(Python)
from sympy import isprime
def ok(n):
if not isprime(n): return False
s, sums = str(n), [0, 0]
for c in s: sums[int(c in "2357")] += int(c)
return sums[0] == sums[1]
print([k for k in range(10**4) if ok(k)]) # Michael S. Branicky, Apr 23 2024
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Gonzalo Martínez, Mar 19 2024
STATUS
approved