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.

Previous Showing 41-43 of 43 results.

A342048 Numbers for which the sum of digits equals the product of nonzero digits.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 22, 30, 40, 50, 60, 70, 80, 90, 100, 123, 132, 200, 202, 213, 220, 231, 300, 312, 321, 400, 500, 600, 700, 800, 900, 1000, 1023, 1032, 1124, 1142, 1203, 1214, 1230, 1241, 1302, 1320, 1412, 1421, 2000, 2002, 2013, 2020, 2031, 2103, 2114, 2130, 2141, 2200
Offset: 1

Views

Author

Ilya Gutkovskiy, Feb 26 2021

Keywords

Examples

			2103 is in the sequence because 2 + 1 + 0 + 3 = 2 * 1 * 3 = 6.
		

Crossrefs

Programs

  • Maple
    q:= n-> (l-> is(add(i, i=l)=mul(i, i=l)))(
            subs(0=[][], convert(n, base, 10))):
    select(q, [$0..3300])[];  # Alois P. Heinz, Feb 26 2021
    # alternative
    G:= proc(d,dmax,s,p) option remember; local i;
       if s + dmax*d < p or s > dmax^d*p then return [] fi;
       if d = 0 then return [[]] fi;
       [seq(op(map(t -> [i,op(t)], procname(d-1,i,s+i,p*i))),i=1..dmax)]
    end proc:
    f:= proc(d) local R,k,i;
      R:= [seq(op(map(t -> [0$k,op(t)], G(d-k,9,0,1))),k=0..d-1)];
      R:= map(op@combinat:-permute,R);
      sort(map(t -> add(t[i]*10^(i-1),i=1..d),R))
    end proc:
    f(4); # Robert Israel, Feb 28 2021
  • Mathematica
    Select[Range[2200], Plus @@ IntegerDigits[#] == Times @@ DeleteCases[IntegerDigits[#], 0] &]
  • PARI
    isok(k) = my(d=select(x->(x>0), digits(k))); vecprod(d) == vecsum(d); \\ Michel Marcus, Feb 26 2021
  • Python
    from math import prod
    def ok(n):
      digs = list(map(int, str(n)))
      return sum(digs) == prod([d for d in digs if d != 0])
    def aupto(lim): return [m for m in range(1, lim+1) if ok(m)]
    print(aupto(2200)) # Michael S. Branicky, Feb 26 2021
    

A249443 Numbers with digits in nondecreasing order and digital sum not larger than the product of the digits.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 22, 23, 24, 25, 26, 27, 28, 29, 33, 34, 35, 36, 37, 38, 39, 44, 45, 46, 47, 48, 49, 55, 56, 57, 58, 59, 66, 67, 68, 69, 77, 78, 79, 88, 89, 99, 123, 124, 125, 126, 127, 128, 129, 133, 134, 135, 136, 137, 138, 139, 144, 145, 146, 147, 148, 149, 155, 156, 157, 158
Offset: 1

Views

Author

M. F. Hasler, Oct 29 2014

Keywords

Comments

Intersection of A009994 and A062998.
Except for the initial 0, a subsequence of the zeroless numbers A052382.
The nonzero terms of this sequence correspond to a term of A061672 obtained by concatenation with A002275(A007954(a(n))-A007953(a(n))).

Crossrefs

Programs

  • PARI
    is(n)={vecsort(n=digits(n))==n && normlp(n,1)<=prod(i=1,#n,n[i])}

A305257 If pd(x) is the product of the digits of the number x and sd(x) the sum of the digits of the number x then the sequence lists all the positive numbers n for which pd(n) = sd(n) and sd(pd(n)) = pd(sd(n)).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 22, 123, 132, 213, 231, 312, 321, 1124, 1142, 1214, 1241, 1412, 1421, 2114, 2141, 2411, 4112, 4121, 4211, 11133, 11222, 11313, 11331, 12122, 12212, 12221, 13113, 13131, 13311, 21122, 21212, 21221, 22112, 22121, 22211, 31113, 31131, 31311, 33111
Offset: 1

Views

Author

Jaroslav Krizek, May 28 2018

Keywords

Comments

Sequence is finite with 48 terms.
Also numbers n such that pd(n) = sd(n) and simultaneously both the additive and multiplicative persistences of n are 0 or 1.
Subsequence of A128290. Intersection of A128290 and A034710.
Numbers k such that A007953(k) = A010888(k) = A007954(k) = A031347(k). - Mohammed Yaseen, Nov 12 2022

Examples

			321 -> sd(321) = 3+2+1 = 6; pd(321) = 3*2*1 = 6; pd(sd(321)) = pd(6) = 6; sd(pd(321)) = sd(6) = 6.
		

Crossrefs

Programs

  • Mathematica
    sod[n_] := Plus@@ IntegerDigits@ n; pod[n_] := Times@@ IntegerDigits@ n; Select[ Range[10^5], pod@ # == sod@ # && pod@ sod@ # == sod@ pod@ # &] (* Giovanni Resta, May 30 2018 *)
  • PARI
    pd(n) = my(d=digits(n)); factorback(d);
    alias(sd, sumdigits);
    isok(n) = my(p=pd(n), s=sd(n)); (p==s) && (sd(p) == pd(s)); \\ Michel Marcus, May 30 2018
    
  • Python
    from math import prod
    def pd(x): return prod(map(int, str(x)))
    def sd(x): return sum(map(int, str(x)))
    def ok(n): return pd(n) == sd(n) and sd(pd(n)) == pd(sd(n))
    print([k for k in range(1, 10**5) if ok(k)]) # Michael S. Branicky, Nov 12 2022
Previous Showing 41-43 of 43 results.