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.

A198376 Largest n-digit number whose product of digits is n or 0 if no such number exists.

Original entry on oeis.org

1, 21, 311, 4111, 51111, 611111, 7111111, 81111111, 911111111, 5211111111, 0, 621111111111, 0, 72111111111111, 531111111111111, 8211111111111111, 0, 921111111111111111, 0, 54111111111111111111, 731111111111111111111, 0, 0, 831111111111111111111111
Offset: 1

Views

Author

Jaroslav Krizek, Oct 23 2011

Keywords

Examples

			113, 131, and 311 are the 3-digit numbers whose product of digits is 3; 311 is the largest.
		

Crossrefs

Cf. A198375 (smallest), A002473, A068191.

Programs

  • Mathematica
    Table[If[FactorInteger[n][[-1, 1]] > 9, 0, i = (10^n - 1)/9; While[i < 10^n && Times @@ (d = IntegerDigits[i]) != n, i++]; If[i == 10^n, 0, FromDigits[Reverse[d]]]], {n, 30}] (* T. D. Noe, Oct 24 2011 *)
  • Python
    def A198376(n):
      ncopy, p, an = n, 1, ""
      for d in range(9, 1, -1):
        while ncopy%d == 0: ncopy//=d; p *= d; an += str(d)
      if p == n and len(an) <= n: return int(an+'1'*(n-len(an)))
      return 0
    print([A198376(n) for n in range(1, 25)]) # Michael S. Branicky, Jan 21 2021

Formula

a(A068191(n)) = 0 for n >=1.
a(n) <> 0 iff n in { A002473 }. - Michael S. Branicky, Jan 21 2021

A221644 Let abcd... be the decimal expansion of k. Sequence lists numbers k such that 1/a + 2/b + 3/c + 4/d + ... is an integer.

Original entry on oeis.org

1, 11, 12, 24, 33, 111, 113, 121, 123, 139, 142, 146, 155, 184, 212, 216, 222, 226, 241, 243, 331, 333, 369, 414, 424, 482, 486, 649, 662, 666, 848, 1111, 1112, 1114, 1128, 1131, 1132, 1134, 1168, 1177, 1196, 1211, 1212, 1214, 1228, 1231, 1232, 1234, 1268
Offset: 1

Views

Author

Michel Lagneau, Aug 08 2013

Keywords

Comments

The repunits numbers 1, 11, 111, 1111, ... (A002275) are in the sequence.
The first nine terms 1, 12, 123, 1234, ... of A007908 are in the sequence.
If a number of the form ab1 is in the sequence, the corresponding number of the form ab3 is also in the sequence.
If a number of the form abc1 is in the sequence, the corresponding number of the form abc2 is also in the sequence.
If a number of the form abc11 is in the sequence, the corresponding number of the form abc15 is also in the sequence.
The first nine terms 1, 12, 113, 1114, 11115, ... of A198375 are in the sequence.
In the general case, if n = abcd...q is in the sequence where q is the k-th decimal digit of n, the number abcd...qr is also in the sequence if k+1 is divisible by r; for example, 82812 is in the sequence => 828121, 828122, 828123 and 828126 are also in the sequence because 6 is divisible by 1, 2, 3 and 6.

Examples

			184 is in the sequence because 1/1 + 2/8 + 3/4 = 2.
		

Crossrefs

Programs

  • Maple
    with(numtheory):for n from 1 to 2000 do: d:=convert(n, base, 10):n1:=nops(d):p:=product('d[i]', 'i'=1..n1):if p<>0 then s:=sum('i/d[n1-i+1] ', 'i'=1..n1):if s=floor(s) then printf(`%d, `,n):else fi:fi:od:
  • Mathematica
    Select[Range[1300],FreeQ[IntegerDigits[#],0]&&IntegerQ[Total[ Range[ IntegerLength[ #]]/ IntegerDigits[ #]]]&] (* Harvey P. Dale, May 16 2018 *)
  • PARI
    isok(n) = my(d=digits(n)); vecmin(d) && (denominator(sum(k=1, #d, k/d[k])) == 1); \\ Michel Marcus, Sep 14 2017
Showing 1-2 of 2 results.