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.
%I A251984 #12 Feb 16 2025 08:33:24 %S A251984 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, %T A251984 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, %U A251984 3,2,1,30,9,8,7,6,5,4,3,2,1,20,9,8,7,6 %N A251984 Smallest number such that a carry occurs when adding it to n in decimal representation. %H A251984 Reinhard Zumkeller, <a href="/A251984/b251984.txt">Table of n, a(n) for n = 1..9999</a> %H A251984 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Carry.html">Carry</a> %H A251984 Wikipedia, <a href="http://en.wikipedia.org/wiki/Carry_(arithmetic)">Carry (arithmetic)</a> %F A251984 a(n) = (10 - A004151(n) mod 10) * 10^A122840(n). %o A251984 (Haskell) %o A251984 a251984 n = if d > 0 then 10 - d else 10 * a251984 n' %o A251984 where (n',d) = divMod n 10 %o A251984 (Python) %o A251984 def a(n): %o A251984 s = str(n) %o A251984 t = s.strip('0') %o A251984 return (10 - int(t)%10) * 10**(len(s) - len(t)) %o A251984 print([a(n) for n in range(1, 85)]) # _Michael S. Branicky_, Sep 08 2021 %Y A251984 Cf. A004151, A122840, A031298, A167832. %K A251984 nonn,base,look %O A251984 1,1 %A A251984 _Reinhard Zumkeller_, Dec 12 2014