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.

A107692 Primes whose product of digits is 6.

Original entry on oeis.org

23, 61, 1123, 1213, 1231, 1321, 2113, 2131, 2311, 3121, 11161, 11213, 11321, 12113, 13121, 16111, 31121, 111611, 611111, 1111213, 1112113, 1112131, 1131121, 1211311, 2111311, 3112111, 11111161, 11112113, 11211131, 11231111, 11312111
Offset: 1

Views

Author

Zak Seidov and Robert G. Wilson v, May 20 2005

Keywords

Crossrefs

Programs

  • Mathematica
    Union[ Flatten[ Table[ Select[ Sort[ FromDigits /@ Join[ Permutations[ Flatten[{6, Table[1, {n}]}]], Permutations[ Flatten[{2, 3, Table[ 1, {n - 1}]}] ]]], PrimeQ[ # ] &], {n, 0, 7}]]]
    Select[Prime[Range[750000]],Times@@IntegerDigits[#]==6&] (* Harvey P. Dale, May 29 2016 *)
  • Python
    from sympy import prod, isprime
    from sympy.utilities.iterables import multiset_permutations
    def agen(maxdigits):
        for digs in range(1, maxdigits+1):
            for mp in multiset_permutations("1"*(digs-1) + "236", digs):
                if prod(map(int, mp)) == 6:
                    t = int("".join(mp))
                    if isprime(t): yield t
    print(list(agen(8))) # Michael S. Branicky, Jun 16 2021