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.

A251984 Smallest number such that a carry occurs when adding it to n in decimal representation.

Original entry on oeis.org

9, 8, 7, 6, 5, 4, 3, 2, 1, 90, 9, 8, 7, 6, 5, 4, 3, 2, 1, 80, 9, 8, 7, 6, 5, 4, 3, 2, 1, 70, 9, 8, 7, 6, 5, 4, 3, 2, 1, 60, 9, 8, 7, 6, 5, 4, 3, 2, 1, 50, 9, 8, 7, 6, 5, 4, 3, 2, 1, 40, 9, 8, 7, 6, 5, 4, 3, 2, 1, 30, 9, 8, 7, 6, 5, 4, 3, 2, 1, 20, 9, 8, 7, 6
Offset: 1

Views

Author

Reinhard Zumkeller, Dec 12 2014

Keywords

Crossrefs

Programs

  • Haskell
    a251984 n = if d > 0 then 10 - d else 10 * a251984 n'
                where (n',d) = divMod n 10
    
  • Python
    def a(n):
        s = str(n)
        t = s.strip('0')
        return (10 - int(t)%10) * 10**(len(s) - len(t))
    print([a(n) for n in range(1, 85)]) # Michael S. Branicky, Sep 08 2021

Formula

a(n) = (10 - A004151(n) mod 10) * 10^A122840(n).