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

A202270 a(n) is the largest n-digit number whose sum of digits is n.

Original entry on oeis.org

1, 20, 300, 4000, 50000, 600000, 7000000, 80000000, 900000000, 9100000000, 92000000000, 930000000000, 9400000000000, 95000000000000, 960000000000000, 9700000000000000, 98000000000000000, 990000000000000000, 9910000000000000000, 99200000000000000000
Offset: 1

Views

Author

Jaroslav Krizek, Jan 06 2012

Keywords

Crossrefs

Cf. A061219 (without zeros).
Cf. A364578 (smallest n-digit number whose sum of digits is n).

Programs

  • Maple
    a:= n-> (q-> parse(cat([9$q, r, 0$(n-q-1)][])))(iquo(n, 9, 'r')):
    seq(a(n), n=1..20);  # Alois P. Heinz, Aug 16 2023
  • PARI
    a(n) = my(k=10^n-1); while (sumdigits(k) != n, k--); k; \\ Michel Marcus, Aug 16 2023
    
  • Python
    def a(n): return int("9"*(m:=n//9)+str(n%9)+"0"*(n-m-1))
    print([a(n) for n in range(1,21)]) # Michael S. Branicky, Aug 16 2023
Showing 1-1 of 1 results.