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.

A128290 If p(x) is the product of the digits of the number x and s(x) the sum of the digits then the sequence lists all the numbers k for which p(s(k)) = s(p(k)), with k >= 1.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 22, 36, 63, 109, 123, 132, 158, 185, 190, 199, 208, 213, 231, 280, 289, 298, 307, 312, 321, 333, 370, 406, 458, 460, 469, 485, 496, 505, 518, 548, 550, 556, 559, 565, 581, 584, 595, 604, 640, 649, 655, 667, 676, 694, 703, 730, 766, 802
Offset: 1

Views

Author

Keywords

Examples

			496 is a term: s(496) = 4+9+6 = 19, p(s(496)) = 1*9 = 9, p(496) = 4*9*6 = 216, s(p(496)) = 2+1+6 = 9.
845 is a term: s(845) = 8+4+5 = 17, p(s(845)) = 1*7 = 7, p(845) = 8*4*5 = 160, s(p(845)) = 1+6+0 = 7.
From _Jon E. Schoenfield_, Jun 15 2024: (Start)
Expressed more visually:
.
          Sum                         Sum
   496 --------> 19            845 --------> 17
    |    4+9+6    |             |    8+4+5    |
  P | 4         P |           P | 8         P |
  r | *         r | 1         r | *         r | 1
  o | 9         o | *         o | 4         o | *
  d | *         d | 9         d | *         d | 7
    | 6           |             | 5           |
    v     Sum     v             v     Sum     v
   216 -------->  9            160 -------->  7
         2+1+6                       1+6+0
(End)
		

Crossrefs

Programs

  • Maple
    P:=proc(q) local a,b,c; a:=convert(q,base,10): b:=convert(a,`+`): c:=convert(a,`*`):
    if convert(convert(b,base,10),`*`)=convert(convert(c,base,10),`+`) then q; fi; end: seq(P(i),i=1..10^3); # Paolo P. Lava, Jun 15 2024
  • Mathematica
    p[n_] := Times @@ IntegerDigits[n]; Select[Range[1000], p[DigitSum[#]] == DigitSum[p[#]] &] (* Paolo Xausa, Jun 17 2024 *)
  • Python
    from math import prod
    def ok(n):
        d = list(map(int, str(n)))
        p, s = prod(d), sum(d)
        return sum(map(int, str(p))) == prod(map(int, str(s)))
    print([k for k in range(1, 803) if ok(k)]) # Michael S. Branicky, Jun 15 2024

A308472 Numbers that are divisible by the sum of the digits of the product of their digits.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 15, 24, 25, 28, 36, 52, 54, 63, 99, 111, 112, 115, 125, 126, 132, 138, 152, 154, 156, 162, 165, 168, 182, 187, 189, 198, 212, 215, 216, 224, 234, 251, 252, 255, 261, 264, 276, 279, 297, 312, 318, 324, 333, 342, 354, 369, 372, 396, 432, 441
Offset: 1

Views

Author

David Consiglio, Jr., May 29 2019

Keywords

Comments

All terms are zeroless (A052382).

Examples

			2771 is a term of this sequence because 2*7*7*1 = 98 --> 9 + 8 = 17 --> 2771 / 17 = 163.
		

Crossrefs

Programs

  • Magma
    [n:n in [1..450]| not 0 in Intseq(n) and IsIntegral(n/(&+Intseq((&*(Intseq(n))))))]; // Marius A. Burtea, May 31 2019
  • Maple
    d:= n-> convert(n, base, 10):
    q:= n-> (m-> m>0 and irem(n, add(j, j=d(m)))=0)(mul(i, i=d(n))):
    select(q, [$1..500])[];  # Alois P. Heinz, May 29 2019
  • Mathematica
    Select[Range[500],DigitCount[#,10,0]==0&&Divisible[#,Total[ IntegerDigits[ Times@@IntegerDigits[#]]]]&] (* Harvey P. Dale, Jan 24 2021 *)
  • PARI
    spd(n) = my(d=digits(n)); sumdigits(vecprod(d)); \\ A128212
    isok(n) = my(p=spd(n)); p && (n % p == 0); \\ Michel Marcus, May 29 2019
    
  • Python
    def dprod(n):
        x = str(n)
        start = 1
        for q in x:
            start *= int(q)
        return start
    def dsum(n):
        x = str(n)
        start = 0
        for q in x:
            start += int(q)
        return start
    seq_1 = [n for n in range(1,10000) if dprod(n) != 0 and n % (dsum(dprod(n))) == 0]
    print(seq_1)
    
Showing 1-2 of 2 results.