cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-2 of 2 results.

A371352 Prime numbers such that the sum of their prime digits is equal to the sum of their nonprime digits.

Original entry on oeis.org

167, 211, 541, 617, 761, 853, 1021, 1201, 1423, 1559, 1607, 1973, 2011, 2143, 2341, 2383, 2833, 3467, 3719, 3823, 3917, 4051, 4231, 4637, 4673, 5261, 5443, 5519, 5591, 6473, 6521, 6701, 7193, 7643, 7687, 7867, 8053, 8233, 8677, 9137, 9173, 9371, 9551
Offset: 1

Views

Author

Gonzalo Martínez, Mar 19 2024

Keywords

Examples

			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.
		

Crossrefs

Cf. A000040, A156343 (equal number of prime and nonprime digits).

Programs

  • Mathematica
    Select[Prime[Range[1200]], Plus @@ Select[d = IntegerDigits[#], PrimeQ[#1] &] == Plus @@ Select[d, ! PrimeQ[#1] &] &] (* Amiram Eldar, Mar 22 2024 *)
  • 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

A369877 Prime numbers p such that the product of their prime digits is equal to the product of their nonprime digits, where p has at least one prime digit.

Original entry on oeis.org

263, 1933, 3319, 3391, 3931, 9133, 11393, 11933, 12163, 12241, 12421, 12613, 13913, 13931, 14221, 16231, 21163, 21613, 24121, 26113, 31139, 31193, 31319, 31391, 32611, 33119, 33191, 33911, 39113, 41221, 61231, 62131, 62311, 63211, 91331, 93113, 93131, 111263
Offset: 1

Views

Author

Gonzalo Martínez, Mar 19 2024

Keywords

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

Examples

			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.
		

Crossrefs

Programs

  • 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 *)
  • 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
Showing 1-2 of 2 results.