OFFSET
0,2
COMMENTS
If n does not end in 9, then a(n) = n + 1, else a(n) is obtained by increasing the last digit of n not equal to 9, and by decreasing the immediately following 9 by 1 (as to get an 8), which is equivalent to adding 9*10^(d-1) where d is the number of trailing 9's in n. In the first case the digital sum of a(n) is 1 more than that of n; in the second case these digital sums are equal.
FORMULA
a(n) = n + 1 unless n=9 (mod 10).
a(n) = n + 9*10^(valuation(n+1,10)-1) if this valuation (largest power of 10 to divide n+1) is positive.
The two cases can be unified as: a(n) = n + ceiling(9*10^(valuation(n+1,10)-1)).
PROG
(PARI) A199343(n)= n+if(n%10<9, 1, 9*10^(valuation(n+1, 10)-1))
CROSSREFS
KEYWORD
nonn,base
AUTHOR
M. F. Hasler, Nov 07 2011
STATUS
approved