

A199344


Least integer > n having a digital sum larger than that of n.


2



1, 2, 3, 4, 5, 6, 7, 8, 9, 19, 11, 12, 13, 14, 15, 16, 17, 18, 19, 29, 21, 22, 23, 24, 25, 26, 27, 28, 29, 39, 31, 32, 33, 34, 35, 36, 37, 38, 39, 49, 41, 42, 43, 44, 45, 46, 47, 48, 49, 59, 51, 52, 53, 54, 55, 56, 57, 58, 59, 69, 61, 62, 63, 64, 65, 66, 67
(list;
graph;
refs;
listen;
history;
text;
internal format)



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^d1 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, x1 equals n with trailing 9's removed. So, x1 does not end in 9, and the next number having a larger digital sum than x1 is a(x1)=x. Therefore, a(n)=(x+1)*10^d1=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(x1)+d*9 = 1+A007953(n).


LINKS

Table of n, a(n) for n=0..66.


FORMULA

a(n)=n+1 unless n=9 (mod 10).
a(n)=n+10^valuation(n+1,10), where the valuation is the highest power of 10 dividing n+1.
A007953(a(n)) = A007953(n)+1.


PROG

(PARI) A199344(n) = n+10^valuation(n+1, 10)


CROSSREFS

Cf. A199343.
Sequence in context: A118763 A098488 A276597 * A259046 A261725 A261729
Adjacent sequences: A199341 A199342 A199343 * A199345 A199346 A199347


KEYWORD

nonn,base


AUTHOR

M. F. Hasler, Nov 07 2011


STATUS

approved



