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-10 of 11 results. Next

A034710 Positive numbers for which the sum of digits equals the product of digits.

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, 11125, 11133, 11152, 11215, 11222, 11251, 11313, 11331, 11512, 11521, 12115, 12122, 12151, 12212, 12221, 12511
Offset: 1

Views

Author

Keywords

Comments

Positive numbers k such that A007953(k) = A007954(k).
If k is a term, the digits of k are solutions of the equation x1*x2*...*xr = x1 + x2 + ... + xr; xi are from [1..9]. Permutations of digits (x1,...,xr) are different numbers k with the same property A007953(k) = A007954(k). For example: x1*x2 = x1 + x2; this equation has only 1 solution, (2,2), which gives the number 22. x1*x2*x3 = x1 + x2 + x3 has a solution (1,2,3), so the numbers 123, 132, 213, 231, 312, 321 have the property. - Ctibor O. Zizka, Mar 04 2008
Subsequence of A249334 (numbers for which the digital sum contains the same distinct digits as the digital product). With {0}, complement of A249335 with respect to A249334. Sequence of corresponding values of A007953(a(n)) = A007954(a(n)): 1, 2, 3, 4, 5, 6, 7, 8, 9, 4, 6, 6, 6, 6, 6, 6, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, ... contains only numbers from A002473. See A248794. - Jaroslav Krizek, Oct 25 2014
There are terms of the sequence ending in any term of A052382. - Robert Israel, Nov 02 2014
The number of digits which are not 1 in a(n) is O(log log a(n)) and tends to infinity as a(n) does. - Robert Dougherty-Bliss, Jun 23 2020

Examples

			1124 is a term since 1 + 1 + 2 + 4 = 1*1*2*4 = 8.
		

Crossrefs

Cf. A066306 (prime terms), A066307 (nonprimes).

Programs

  • Haskell
    import Data.List (elemIndices)
    a034710 n = a034710_list !! (n-1)
    a034710_list = elemIndices 0 $ map (\x -> a007953 x - a007954 x) [1..]
    -- Reinhard Zumkeller, Mar 19 2011
    
  • Magma
    [n: n in [1..10^6] | &*Intseq(n) eq &+Intseq(n)] // Jaroslav Krizek, Oct 25 2014
    
  • Mathematica
    Select[Range[12512], (Plus @@ IntegerDigits[ # ]) == (Times @@ IntegerDigits[ # ]) &] (* Alonso del Arte, May 16 2005 *)
  • PARI
    is(n)=my(d=digits(n)); vecsum(d)==factorback(d) \\ Charles R Greathouse IV, Feb 06 2017

Extensions

Corrected by Larry Reeves (larryr(AT)acm.org), Jun 27 2001
Definition changed by N. J. A. Sloane to specifically exclude 0, Sep 22 2007

A066307 Nonprimes whose sum of digits is equal to its product of digits.

Original entry on oeis.org

1, 4, 6, 8, 9, 22, 123, 132, 213, 231, 312, 321, 1124, 1142, 1214, 1241, 1412, 1421, 2114, 4112, 4121, 11125, 11133, 11152, 11215, 11222, 11313, 11331, 11512, 11521, 12115, 12122, 12151, 12212, 12221, 13113, 13131, 13311, 15112, 15211, 21115
Offset: 1

Views

Author

Labos Elemer, Dec 13 2001

Keywords

Examples

			321 = 3*107, 3 + 2 + 1 = 6 = 3*2*1.
		

Crossrefs

Composites and 1 from A034710.

Programs

  • Mathematica
    sdpdQ[n_]:=Module[{idn=IntegerDigits[n]},Total[idn]==Times@@idn]; Module[ {upto=25000, cs},cs=Complement[Range[upto],Prime[Range[PrimePi[upto]]]];Select[cs,sdpdQ]] (* Harvey P. Dale, Oct 14 2014 *)
  • PARI
    isok(k) = {if(isprime(k), 0, my(d=digits(k)); vecprod(d) == vecsum(d))} \\ Harry J. Smith, Feb 09 2010

A066310 Numbers k such that k < (product of digits of k) * (sum of digits of k).

Original entry on oeis.org

2, 3, 4, 5, 6, 7, 8, 9, 14, 15, 16, 17, 18, 19, 23, 24, 25, 26, 27, 28, 29, 33, 34, 35, 36, 37, 38, 39, 42, 43, 44, 45, 46, 47, 48, 49, 52, 53, 54, 55, 56, 57, 58, 59, 62, 63, 64, 65, 66, 67, 68, 69, 72, 73, 74, 75, 76, 77, 78, 79, 82, 83, 84, 85, 86, 87, 88, 89, 92, 93, 94, 95
Offset: 1

Views

Author

Labos Elemer and Klaus Brockhaus, Dec 13 2001

Keywords

Examples

			14 < (1*4)*(1+4) = 20, so 14 is a term of this sequence.
For n=199, (1+9+9)*1*9*9 = 1539 > 199, so 199 is here.
		

Crossrefs

Programs

  • ARIBAS
    function a066311(a,b: integer); var n,k,j,p,d: integer; s: string; begin for n := a to b do s := itoa(n); k := 0; p := 1; for j := 0 to length(s) - 1 do d := atoi(s[j..j]); k := k + d; p := p*d; end; if n < p*k then write(n,","); end; end; end; a066311(0,120);
    
  • Mathematica
    asum[x_] := Apply[Plus, IntegerDigits[x]] apro[x_] := Apply[Times, IntegerDigits[x]] sz[x_] := asu[x]*apro[x] Do[s=sz[n]; If[Greater[s, n], Print[n]], {n, 1, 200}]
  • PARI
    isok(m) = my(d=digits(m)); m < vecprod(d)*vecsum(d); \\ Michel Marcus, Mar 23 2020

A384444 Positive integers k for which the sum of their digits equals the product of their prime digits.

Original entry on oeis.org

1, 2, 3, 5, 7, 10, 20, 22, 30, 50, 70, 100, 123, 132, 200, 202, 213, 220, 231, 300, 312, 321, 500, 700, 1000, 1023, 1032, 1203, 1230, 1247, 1274, 1302, 1320, 1356, 1365, 1427, 1472, 1536, 1563, 1635, 1653, 1724, 1742, 2000, 2002, 2013, 2020, 2031, 2103, 2130, 2147
Offset: 1

Views

Author

Felix Huber, Jun 03 2025

Keywords

Comments

Numbers k for which A007953(k) = A384443(k).
If t is a term then t*10^m is also a term for any positive integer m.

Examples

			1302 is a term, because 1 + 3 + 0 + 2 = 3*2 = 6.
		

Crossrefs

Programs

  • Maple
    A384444:=proc(n)
        option remember;
        local k,c;
        if n=1 then
            1
        else
            for k from procname(n-1)+1 do
                c:=convert(k,'base',10);
                if mul(select(isprime,c))=add(c) then
                    return k
                fi
            od
        fi;
    end proc;
    seq(A384444(n),n=1..51);
  • Mathematica
    Select[Range[2147],Total[IntegerDigits[#]]==Times@@Select[IntegerDigits[#],PrimeQ]&] (* James C. McMahon, Jun 20 2025 *)
  • PARI
    isok(k) = my(d=digits(k)); vecprod(select(isprime, d)) == vecsum(d); \\ Michel Marcus, Jun 04 2025

A384445 a(n) is the number of multisets of n decimal digits where the sum of the digits equals the product of the prime digits.

Original entry on oeis.org

5, 6, 7, 10, 23, 43, 74, 125, 199, 305, 449, 637, 885, 1216, 1649, 2184, 2852, 3664, 4657, 5863, 7298, 9002, 10993, 13312, 16000, 19084, 22613, 26606, 31120, 36192, 41867, 48220, 55317, 63232, 72022, 81746, 92479, 104282, 117229, 131393, 146843, 163652, 181892
Offset: 1

Views

Author

Felix Huber, Jun 03 2025

Keywords

Examples

			a(3) = 7 because exactly for the 7 multisets with 3 digits {0, 0, 1}, {0, 0, 2}, {0, 0, 3}, {0, 0, 5}, {0, 0, 7}, {0, 2, 2} and {1, 2, 3} their sum equals the product of the prime digits.
a(4) = 10 because exactly for the 10 multisets with 4 digits {0, 0, 0, 1}, {0, 1, 2, 3}, {1, 2, 4, 7}, {1, 3, 5, 6}, {0, 0, 0, 2}, {0, 0, 2, 2}, {0, 0, 0, 3}, {0, 0, 0, 5}, {5, 5, 6, 9} and {0, 0, 0, 7} their sum equals the product of the prime digits.
		

Crossrefs

Programs

  • Maple
    f:=proc(p,n)
        local c,d,i,l,m,r,s,t,u,w,x,y,z;
        m:={0,1,4,6,8,9};
        t:=seq(cat(x,i),i in m);
        y:={l='Union'(t),w='Set'(l),t=~'Atom'};
        d:=(map2(apply,s,{t})=~m) union {s(w)='Set'(s(l))};
        Order:=p+1;
        r:=combstruct:-agfseries(y,d,'unlabeled',z,[[u,s]])[w(z,u)];
        r:=collect(convert(r,'polynom'),[z,u],'recursive');
        c:=coeff(r,z,p);
        coeff(c,u,n)
    end proc:
    A384445:=proc(n)
        local a,k,m,s,p,j,L;
        a:=1;
            for k from 9*n to 1 by -1 do
                L:=ifactors(k)[2];
                m:=nops(L);
                if m>0 and L[m,1]<=7 then
                    p:=n-add(L[j,2],j=1..m);
                    s:=k-add(L[j,1]*L[j,2],j=1..m);
                    if s=0 and p>=0 then
                        a:=a+1
                    elif p>0 and s>0 then
                        a:=a+f(p,s)
                    fi
                fi
    	od;
    	return a
    end proc;
    seq(A384445(n),n=1..43);

A384505 a(n) is the number of multisets of n positive decimal digits where the sum of the digits equals the product of the prime digits.

Original entry on oeis.org

5, 1, 1, 3, 13, 20, 31, 51, 74, 106, 144, 188, 248, 331, 433, 535, 668, 812, 993, 1206, 1435, 1704, 1991, 2319, 2688, 3084, 3529, 3993, 4514, 5072, 5675, 6353, 7097, 7915, 8790, 9724, 10733, 11803, 12947, 14164, 15450, 16809, 18240, 19757, 21374, 23073, 24876, 26759
Offset: 1

Views

Author

Felix Huber, Jun 11 2025

Keywords

Examples

			a(1) = 5 because exactly for the 5 multisets with 1 digits {1}, {2}, {3}, {5}, and {7} their sum equals the product of the prime digits.
a(2) = 1 because only for 1 multiset with 2 positive digits {2, 2} their sum equals the product of the prime digits: 2 + 2 = 2*2 = 4.
a(3) = 1 because only for 1 multiset with 3 positive digits {1, 2, 3} their sum equals the product of the prime digits: 1 + 2 + 3 = 2*3 = 6.
a(4) = 3 because exactly for the 3 multisets with 4 digits {1, 2, 4, 7}, {1, 3, 5, 6}, and {5, 5, 6, 9} their sum equals the product of the prime digits: 1 + 2 + 4 + 7 = 2 * 7 = 14, 1 + 3 + 5 + 6 = 3*5 = 15, 5 + 5 + 6 + 9 = 5*5 = 25.
		

Crossrefs

Programs

  • Maple
    f:=proc(p,n)
        local i,l,m,s,t,u,w,x,z;
        m:={1,4,6,8,9};
        t:=seq(cat(x,i),i in m);
        Order:=p+1;
        coeff(coeff(collect(convert(combstruct:-agfseries({l='Union'(t),w='Set'(l),t=~'Atom'},(map2(apply,s,{t})=~m) union {s(w)='Set'(s(l))},'unlabeled',z,[[u,s]])[w(z,u)],'polynom'),[z,u],'recursive'),z,p),u,n)
    end proc:
    A384505:=proc(n)
        local a,k,m,s,p,j,L;
        if n=1 then
            5
        elif n=2 then
            1
        else
            a:=0;
            for k from 9*n to 1 by -1 do
                L:=ifactors(k)[2];
                m:=nops(L);
                if m>0 and L[m,1]<=7 then
                    p:=n-add(L[j,2],j=1..m);
                    s:=k-add(L[j,1]*L[j,2],j=1..m);
                    if p>0 and s>0 then
                        a:=a+f(p,s)
                    fi
                fi
    	od;
    	return a
    	fi;
    end proc;
    seq(A384505(n),n=1..48);

Formula

a(n) = A384445(n) - A384445(n-1) for n > 1.

A066309 Numbers k such that k > (product of digits of k) * (sum of digits of k).

Original entry on oeis.org

10, 11, 12, 13, 20, 21, 22, 30, 31, 32, 40, 41, 50, 51, 60, 61, 70, 71, 80, 81, 90, 91, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 130, 131, 132, 133, 134, 140, 141, 142
Offset: 1

Views

Author

Labos Elemer and Klaus Brockhaus, Dec 13 2001

Keywords

Examples

			13 is in the sequence because (1*3)*(1+3) = 3*4 = 12 < 13.
125 is a term because (1*2*5)*(1+2+5) = 10*8 = 80 < 125.
		

Crossrefs

Programs

  • ARIBAS
    function a066312(a,b: integer); var n,k,j,p,d: integer; s: string; begin for n := a to b do s := itoa(n); k := 0; p := 1; for j := 0 to length(s) - 1 do d := atoi(s[j..j]); k := k + d; p := p*d; end; if n > p*k then write(n,","); end; end; end; a066312(0,150);
    
  • Mathematica
    asum[x_] := Apply[Plus, IntegerDigits[x]] apro[x_] := Apply[Times, IntegerDigits[x]] sz[x_] := asu[x]*apro[x] Do[s=sz[n]; If[Greater[n, s], Print[n]], {n, 1, 1000}]
    okQ[n_]:=Module[{idn=IntegerDigits[n]},n> Total[idn]Times@@idn];Select[Range[150],okQ]  (* Harvey P. Dale, Mar 12 2011 *)
  • PARI
    isok(k) = {my(d=digits(k)); k > vecprod(d) * vecsum(d)} \\ Harry J. Smith, Feb 10 2010

A272436 Semiprimes such that sum of digits equals product of digits.

Original entry on oeis.org

4, 6, 9, 22, 123, 213, 321, 1142, 1214, 1241, 4121, 11215, 11521, 12115, 12151, 21151, 22121, 51211, 111261, 112611, 116121, 116211, 121161, 162111, 211611, 261111, 621111, 1111217, 1111413, 1111431, 1111721, 1112117, 1117121, 1117211, 1121117, 1121171, 1121711
Offset: 1

Views

Author

K. D. Bajpai, May 06 2016

Keywords

Comments

Intersection of A001358 and A034710.
9 is the only member with digit 9. No member has more than one digit 3 or 6. - Robert Israel, May 06 2016

Examples

			1142 appears in the list because 1142 = 2*571 that is semiprime. Also, 1+1+4+2 = 8 = 1*1*4*2.
11215 appears in the list because 1142 = 5*2243 that is semiprime. Also, 1+1+2+1+5 = 10 = 1*1*2*1*5.
		

Crossrefs

Programs

  • Maple
    R:= proc(k,d,u,v) option remember;
        if k = 1 then
            if d = v - u then {[d]}
            else {}
            fi
        else
          `union`(seq(map(t -> [op(t),s], procname(k-1,d-s,u+s*k,v*k^s)),s=0..d))
        fi
    end proc:
    A034710:= proc(d)
      local res, r,  i, t;
      res:= NULL;
      for r in R(9,d,0,1) do
         res:= res, op(map(t -> add(10^(i-1)*t[i],i=1..nops(t)), combinat:-permute([seq(i$r[i],i=1..9)])));
      od:
      sort([res]);
    end proc:
    map(op, [seq(select(t -> numtheory:-bigomega(t)=2, A034710(i)),i=1..11)]); # Robert Israel, May 06 2016
  • Mathematica
    Select[Range[10000000], (Plus @@ IntegerDigits[#]) == (Times @@ IntegerDigits[#]) && PrimeOmega[#] == 2 &]

A260904 Prime numbers such that sum of digits in base 16 equals product of digits in base 16.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 4673, 5153, 8513, 16673, 17895719, 17899799, 17985809, 18288929, 34697489, 40964369, 118563089, 286337041, 286359841, 293675281, 403775761, 554766721, 554795281, 73303933201, 74109227281, 1172812415521, 1172812443937, 1172812468507
Offset: 1

Views

Author

Chai Wah Wu, Nov 17 2015

Keywords

Examples

			16673_10 = 4121_16 is prime and the sum of digits of 4121 equals the product of digits.
		

Crossrefs

Cf. A066306.

Programs

  • Mathematica
    Select[Prime@ Range[10^7], Total@ # == Times @@ # &@ IntegerDigits[#, 16] &] (* Michael De Vlieger, Nov 18 2015 *)

A264576 Prime numbers such that sum of digits in base 8 equals product of digits in base 8.

Original entry on oeis.org

2, 3, 5, 7, 83, 139, 673, 1289, 2129, 5197, 5449, 6737, 6793, 8849, 12889, 13001, 21577, 38281, 58441, 70537, 90697, 300809, 311897, 398921, 2400851, 2400907, 2429579, 2430601, 2462353, 2658899, 2691659, 2724937, 2925137, 2925193, 2925641, 2957897, 4494929
Offset: 1

Views

Author

Chai Wah Wu, Nov 17 2015

Keywords

Examples

			300809_10 = 1113411_8 is prime and the sum of digits of 1113411 is equal to the product of digits.
		

Crossrefs

Cf. A066306.

Programs

  • Mathematica
    Select[Prime@ Range[10^6], Total@ # == Times @@ # &@ IntegerDigits[#, 8] &] (* Michael De Vlieger, Nov 18 2015 *)
Showing 1-10 of 11 results. Next