login
A243075
Least number k such that k + DigitSum(k) = 10^n or 0 if no such number exists.
0
5, 86, 977, 9968, 99959, 0, 9999950, 99999941, 999999932, 9999999923, 99999999914, 999999999896, 9999999999887, 99999999999878, 999999999999869, 0, 99999999999999860, 999999999999999851, 9999999999999999842, 99999999999999999833, 999999999999999999824, 9999999999999999999815
OFFSET
1,1
COMMENTS
a(n) < 10^n and a(n) > [10^n-9*n]. Thus a(n) = 0 is definite.
EXAMPLE
5+5 = 10^1 so a(1) = 5.
86+(8+6) = 10^2 so a(2) = 86.
PROG
(PARI) DS(n) = {t=0; for(i=1, #digits(n), t+=digits(n)[i]); return(t)}
a(n)=for(k=(10^n-9*n), 10^n, if(k+DS(k)==10^n, return(k)))
n=1; while(n<100, print1(a(n), ", "); n+=1)
CROSSREFS
Cf. A007953.
Sequence in context: A140159 A073862 A222983 * A232489 A318219 A182963
KEYWORD
nonn,base
AUTHOR
Derek Orr, May 30 2014
STATUS
approved