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-9 of 9 results.

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

A066306 Prime numbers such that sum of digits equals product of digits.

Original entry on oeis.org

2, 3, 5, 7, 2141, 2411, 4211, 11251, 12511, 15121, 21221, 25111, 1112171, 1127111, 1172111, 1271111, 7112111, 11112811, 11128111, 11218111, 12111811, 12118111, 12181111, 18211111, 81111211, 81112111
Offset: 1

Views

Author

Labos Elemer, Dec 13 2001

Keywords

Examples

			2141 = p[323], 2*1*4*1 = 8 = 2+1+4+1.
		

Crossrefs

Primes from A034710.

Programs

  • Magma
    [NthPrime(n): n in [1..2*10^4] | &+Intseq(NthPrime(n)) eq &*Intseq(NthPrime(n))]; // Vincenzo Librandi, Nov 18 2015
  • Mathematica
    f[n_] := IntegerDigits[ Prime[n]]; Prime[ Select[ Range[ PrimePi[10^10]], Apply[Plus, f[ # ]] == Apply[Times, f[ # ]] & ]]

Extensions

More terms from Robert G. Wilson v, Dec 27 2001

A249334 Numbers for which the digital sum contains the same distinct digits as the digital product.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 22, 99, 123, 132, 213, 231, 312, 321, 1124, 1137, 1142, 1173, 1214, 1241, 1317, 1371, 1412, 1421, 1713, 1731, 2114, 2141, 2411, 3117, 3171, 3344, 3434, 3443, 3711, 4112, 4121, 4211, 4334, 4343, 4433, 7113, 7131, 7311, 11125, 11133
Offset: 1

Views

Author

Jaroslav Krizek, Oct 25 2014

Keywords

Comments

Numbers k such that A007953(k) contains the same distinct digits as A007954(k). (But either of the two may contain some digit(s) more than once.)
Supersequence of A034710 (positive numbers for which the sum of digits is equal to the product of digits).
Union of A034710 and A249335.
The sequence is infinite since, e.g., A002275(n) = (10^n-1)/9 is in the sequence for all n = A002275(k), k>=0; and more generally N(k,d) = A002275(n)-1+d with n = (A002275(k)-1)*d+1, k>0 and 0M. F. Hasler, Oct 29 2014

Examples

			1137 is a term because 1+1+3+7 = 12 and 1*1*3*7 = 21.
3344 is a term because 3+3+4+4=14 has the same (distinct) digits as 3*3*4*4=144.
		

Crossrefs

Programs

  • Magma
    [0] cat [n: n in [1..10^6] | Set(Intseq(&*Intseq(n))) eq Set(Intseq(&+Intseq(n)))];
    
  • Mathematica
    Select[Range[0,12000],Union[IntegerDigits[Total[IntegerDigits[#]]]]==Union[IntegerDigits[Times@@IntegerDigits[#]]]&] (* Harvey P. Dale, Aug 17 2025 *)
  • PARI
    is_A249334(n)=Set(digits(sumdigits(n)))==Set(digits(prod(i=1,#n=digits(n),n[i]))) \\ M. F. Hasler, Oct 29 2014

A066308 a(n) = (sum of digits of n) * (product of digits of n).

Original entry on oeis.org

1, 4, 9, 16, 25, 36, 49, 64, 81, 0, 2, 6, 12, 20, 30, 42, 56, 72, 90, 0, 6, 16, 30, 48, 70, 96, 126, 160, 198, 0, 12, 30, 54, 84, 120, 162, 210, 264, 324, 0, 20, 48, 84, 128, 180, 240, 308, 384, 468, 0, 30, 70, 120, 180, 250, 330, 420, 520, 630, 0, 42, 96, 162, 240, 330
Offset: 1

Views

Author

Labos Elemer, Dec 13 2001

Keywords

Comments

a(n) can be greater than, less than, or equal to n; see Example section.

Examples

			For n = 12, a(12) = (1 + 2)*(1*2) = 3*2 = 6 < n;
for n = 19, a(19) = (1 + 9)*(1*9) = 90 > n;
for n = 135, a(135) =(1 + 3 + 5)*(1*3*5) = 135 = n.
		

Crossrefs

Programs

  • Mathematica
    asum[x_] := Apply[Plus, IntegerDigits[x]] apro[x_] := Apply[Times, IntegerDigits[x]] a[n]=asum[n]*apro[n]
    sdpd[n_]:=Module[{idn=IntegerDigits[n]},Total[idn]Times@@idn]; Array[ sdpd,70] (* Harvey P. Dale, Dec 31 2011 *)
  • PARI
    a(n) = my(d = digits(n)); vecsum(d) * vecprod(d); \\ Michel Marcus, Feb 24 2017

Extensions

Edited by Jon E. Schoenfield, Jul 09 2018

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

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

A297815 Number of positive integers with n digits whose digit sum is equal to its digit product.

Original entry on oeis.org

9, 1, 6, 12, 40, 30, 84, 224, 144, 45, 605, 495, 1170, 1092, 210, 240, 2448, 4896, 15846, 3420, 1750, 462, 15939, 0, 8100, 67925, 80730, 19656, 11774, 164430, 930, 29760, 197472, 0, 0, 1260, 23976, 50616, 54834, 395200, 1248860, 4253340, 75852, 0, 42570
Offset: 1

Views

Author

Reiner Moewald, Jan 06 2018

Keywords

Examples

			The only term with two digits is 22: 2 * 2 = 2 + 2.
		

Crossrefs

Programs

  • Mathematica
    cperm[w_] := Length[w]!/Times @@ ((Last /@ Tally[w])!); ric[s_, p_, w_, tg_] := Block[{d}, If[tg == 0, If[s == p, tot += cperm@ w], Do[ If[p*d > s + d + (tg-1)*9, Break[]]; ric[s+d, p*d, Append[w,d], tg-1], {d, Last@ w, 9}]]]; a[n_] := (tot=0; ric[#, #, {#}, n-1] & /@ Range[9]; tot); Array[a, 45] (* Giovanni Resta, Feb 05 2018 *)
  • Python
    import math
    def digitProd(natNumber):
        digitProd = 1
        for letter in str(natNumber):
            digitProd *= int(letter)
        return digitProd
    def digitSum(natNumber):
        digitSum = 0
        for letter in str(natNumber):
            digitSum += int(letter)
        return digitSum
    for n in range(24):
        count = 0
        for a in range(int(math.pow(10,n)), int(math.pow(10, n+1))):
            if digitProd(a) == digitSum(a):
                count += 1
        print(n+1, count)
    
  • Python
    from sympy.utilities.iterables import combinations_with_replacement
    from sympy import prod, factorial
    def A297815(n):
        f = factorial(n)
        return sum(f//prod(factorial(d.count(a)) for a in set(d)) for d in combinations_with_replacement(range(1,10),n) if prod(d) == sum(d)) # Chai Wah Wu, Feb 06 2018

Extensions

a(10) and a(23) corrected by and a(25)-a(45) from Giovanni Resta, Feb 05 2018

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])}

A274368 Numbers k such that if k is decreased by the sum of its digits and k is decreased by the product of its digits both differences are squares > 0.

Original entry on oeis.org

45, 48, 231, 121116, 159229, 11985489, 17514256, 51624256, 88172137, 228523729, 467597425, 11112111412, 4329279198937, 3716589421762641, 23228676113127556, 138417183479417732388
Offset: 1

Views

Author

Pieter Post, Jun 19 2016

Keywords

Comments

It appears that if k is increased by the sum of its digits and k is increased by the product of its digits no two squares are found, except for the trivial k = 2 and k = 8.
The smallest k>8 such that k+A007953(k) and k+A007954(k) are both squares is k = 6469753431969. If a fourth such k exists, it must be larger than 1.6*10^19. - Giovanni Resta, Jun 19 2016

Examples

			45 - (4 + 5) = 36 and 45 - (4 * 5) = 25.
159229 - (1 + 5 + 9 + 2 + 2 + 9) = 157609 (= 397^2) and 159229 - (1*5*9*2*2*9) = 159201 (= 399^2).
From _David A. Corneth_, May 27 2021: (Start)
If the digits of a(n) = x are an anagram of 122599 then the product of digits is 1 * 2 * 2 * 5 * 9 * 9 = 1620 and the sum of digits is 1 + 2 + 2 + 5 + 9 + 9 = 28 as order of addition and multiplication does not matter. So x - 31 = m^2 and x - 1620 = k^2 for some positive integers k and m.
So m^2 - k^2 = (x - 28) - (x - 1620) = 1592 = (m - k)*(m + k). The divisors of 1592 are 1, 2, 4, 8, 199, 398, 796, 1592. Testing possible pairs m-k and m+k gives, among other pairs, (m - k, m + k) = (2, 796). Solving for k gives k = 397 so x = k^2 + 1620 = 397^2 + 1620 = 159229 giving an extra term. (End)
		

Crossrefs

Intersection of A066566 and A228187.

Programs

  • Mathematica
    lim = 10^6; s = Select[Range@ lim, IntegerQ@ # && # != 0 &@ Sqrt[# - Times @@ IntegerDigits@ #] &]; t = Select[Range@ lim, IntegerQ@ # && # != 0 &@ Sqrt[# - Total@ IntegerDigits@ #] &]; Intersection[s, t] (* Michael De Vlieger, Jun 19 2016 *)
  • PARI
    a007953(n) = sumdigits(n)
    a007954(n) = my(d=digits(n)); prod(i=1, #d, d[i])
    is(n) = n > 9 && issquare(n-a007953(n)) && issquare(n-a007954(n)) \\ Felix Fröhlich, Jun 19 2016
  • Python
    def pod(n):
        p = 1
        for x in str(n):
            p *= int(x)
        return p
    def sod(n):
        return sum(int(d) for d in str(n))
    def cube(z,p):
        iscube=False
        y=int(pow(z,1/p)+0.01)
        if y**p==z:
            iscube=True
        return iscube
    for c in range(1, 10**8):
        aa,ab=c-pod(c),c-sod(c)
        if cube(aa,2) and cube(ab,2) and aa>0:
           print(c,aa,ab)
    

Extensions

a(10)-a(15) from Giovanni Resta, Jun 19 2016
a(16) from David A. Corneth, May 27 2021
Showing 1-9 of 9 results.