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

A034727 a(n) = that n-digit number m which gives minimal integral value of m/(sum of digits of m); in case of a tie pick the smallest.

Original entry on oeis.org

1, 18, 198, 1098, 10989, 109888, 1078999, 10998988, 109989999, 1078999989, 10999999989, 108999999989, 1098999999999, 10899899999998, 104999999999999, 1018899999999999, 10199998999999998, 100999999999999988
Offset: 1

Views

Author

Keywords

Crossrefs

A066007 a(n) is that n-digit number m which minimizes m/(sum of digits of m); in case of a tie pick the smallest.

Original entry on oeis.org

1, 19, 199, 1099, 10999, 109999, 1099999, 10999999, 109999999, 1099999999, 10999999999, 109999999999, 1099999999999, 10999999999999, 100999999999999, 1009999999999999, 10099999999999999, 100999999999999999, 1009999999999999999, 10099999999999999999
Offset: 1

Views

Author

N. J. A. Sloane, Dec 11 2001

Keywords

Crossrefs

Programs

  • Python
    def k(r): return (10**r - 1)//9 + r + 2
    def a(n):
      r = 0
      while k(r+1) <= n: r += 1
      return int('1' + '0'*r + '9'*(n-r-1))
    print([a(n) for n in range(1, 21)]) # Michael S. Branicky, Jan 19 2021

Formula

1 followed by 0's followed by 9's; the first time r 0's appear is at n = (10^r-1)/9+r+2.

A066008 Number of n-digit positive integers m for which m/(sum of digits of m) is an integer, sometimes referred to as Niven or Harshad numbers.

Original entry on oeis.org

9, 23, 180, 1325, 10334, 83556, 710667, 6148698, 54619717, 491432596, 4471325309, 40951585117
Offset: 1

Views

Author

N. J. A. Sloane, Dec 11 2001

Keywords

Comments

Harshad numbers were named by D. Kaprekar; the word "harshad" in Sanskrit means "giving joy." - Harvey P. Dale, Nov 08 2011

Crossrefs

Programs

  • ARIBAS
    : function a066008(a,b: integer); var n,c,m,j,k: integer; s: string; begin for n := a to b do c := 0; for m := 10^n to 10^(n+1) - 1 do s := itoa(m); k := 0; for j := 0 to length(s) - 1 do k := k + atoi(s[j..j]); end; if m mod k = 0 then inc(c); end; end; write(c,","); end; return; end; a066008(0,7).
    
  • Python
    def sd(m): return sum(map(int, str(m)))
    def is_harshad(m): return m > 0 and m%sd(m) == 0
    def a(n): return sum(is_harshad(m) for m in range(10**(n-1), 10**n))
    print([a(n) for n in range(1, 7)]) # Michael S. Branicky, Sep 23 2021

Extensions

One more term from Klaus Brockhaus, Dec 12 2001
a(9)-a(12) from Donovan Johnson, Mar 10 2010
Definition expanded by Harvey P. Dale, Nov 08 2011

A034728 Sum of digits of A034727(n).

Original entry on oeis.org

1, 9, 18, 18, 27, 34, 43, 52, 63, 69, 81, 89, 99, 106, 113, 117, 126, 134, 147
Offset: 1

Views

Author

Keywords

Crossrefs

Showing 1-4 of 4 results.