OFFSET
0,2
COMMENTS
It turns out the "larger than..." in the definition is always equivalent to "equal to 1 +...". Indeed, we have a(n)=n+1 unless n=9 (mod 10). In the latter case, write n = x*10^d-1 where x does not end in '0', i.e. d equals the number of trailing 9's in n, and x equals n+1 with the d trailing zeros removed. In other words, x-1 equals n with trailing 9's removed. So, x-1 does not end in 9, and the next number having a larger digital sum than x-1 is a(x-1)=x. Therefore, a(n)=(x+1)*10^d-1=n+10^d, i.e. the concatenation of x and the trailing 9's of n, which has a digital sum equal to A007953(x)+d*9 = 1+A007953(x-1)+d*9 = 1+A007953(n).
FORMULA
PROG
(PARI) A199344(n) = n+10^valuation(n+1, 10)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
M. F. Hasler, Nov 07 2011
STATUS
approved