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.

A064155 Primes whose product of digits equals the number of digits times the sum of digits.

Original entry on oeis.org

2, 3, 5, 7, 167, 523, 617, 761, 1427, 2417, 2741, 4127, 4217, 4271, 4721, 126241, 126421, 146221, 212461, 216421, 221461, 224611, 226141, 241261, 242161, 246121, 261241, 262411, 264211, 421621, 426211, 621241, 642121, 642211, 1111457, 1111547, 1115417, 1117451
Offset: 1

Views

Author

Felice Russo, Sep 14 2001

Keywords

Examples

			167 belongs to the sequence because 1*6*7 = 42 and 3*(1+6+7) = 42.
		

Crossrefs

Primes in A064154.

Programs

  • Mathematica
    Select[Prime@Range@1000000, Plus@@(i=IntegerDigits@#)*Length@i == Times@@i&] (*Hans Rudolf Widmer, Jun 13 2024*)
  • PARI
    isok(k)={ if(isprime(k), my(d=digits(k)); vecprod(d)==#d * vecsum(d), 0) } \\ Harry J. Smith, Sep 09 2009
    
  • Python
    from math import prod
    from sympy import isprime
    from sympy.utilities.iterables import multiset_permutations as mp
    from itertools import count, islice, combinations_with_replacement as mc
    def c(s):
        d = list(map(int, s))
        return prod(d) == len(d)*sum(d)
    def agen():
        yield from (2, 3, 5, 7)
        for d in count(2):
            okset = set()
            for cand in ("".join(m) for m in mc("987654321", d)):
                if c(cand):
                    for p in mp(cand, d):
                        t = int("".join(p))
                        if isprime(t): okset.add(t)
            yield from sorted(okset)
    print(list(islice(agen(), 38))) # Michael S. Branicky, Nov 30 2022

Extensions

Name edited by Andrew Howroyd, Dec 05 2024

A316147 Numbers, with digits in nondecreasing order, whose product of digits equals the number of digits times the sum of digits.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 36, 44, 159, 167, 235, 333, 1247, 1344, 2226, 11259, 11355, 111279, 111366, 112239, 112246, 112335, 1111377, 1111457, 1112337, 11111388, 11112267, 11113344, 11122236, 11222224, 111111399, 111111559, 111111666, 111112269
Offset: 1

Views

Author

David A. Corneth, Jun 25 2018

Keywords

Comments

This sequence can be used to find terms of A064154 by permuting digits of terms of this sequence.

Crossrefs

Cf. A064154.

Programs

  • Mathematica
    Union@ Flatten@ Reap[ Sow[0]; Do[ If[ FactorInteger[ nd s ][[-1, 1]] <= 7, Sow[ FromDigits /@ Reverse /@ Select[ IntegerPartitions[s, {nd}, Range[9]], Times @@ # == Length[#] Plus @@ # &]]], {nd, 18}, {s, 9 nd}]][[2, 1]] (* terms < 10^18, Giovanni Resta, Jul 18 2018 *)
    dnoQ[n_]:=Module[{idn=IntegerDigits[n]},Min[Differences[idn]]>=0 && Times@@idn==Length[idn]Total[idn]]; Select[Range[0, 111112300],dnoQ] (* Harvey P. Dale, Aug 12 2021 *)
  • PARI
    is(n) = my(d = digits(n)); vecsort(d) == d && prod(i=1, #d, d[i]) == #d * vecsum(d) \\ David A. Corneth, Jul 18 2018
Showing 1-2 of 2 results.