OFFSET
0,2
COMMENTS
The offset could equally well be chosen to be 1, but taking it equal to zero allows us to consider {a(n); n=0,1,2...} and {a(n); n=1,2...} together, both of which satisfy the definition.
All terms are divisible by 9, but there is no limit on the size of the gaps. The first gap of 18 occurs after a(9)=81 followed by a(10)=99, the first gap of 27 after a(79)=972 followed by a(80)=999.
There seems also to be no limit on the "look-ahead" required to avoid getting stuck by a bad choice.
LINKS
M. F. Hasler, Table of n, a(n) for n = 0..1000
E. Angelini, Cumulative sum of the digits used so far, SeqFan mailing list, Oct 30 2014
PROG
(PARI) a(n, a=0, L=19)={local(ok(n, L)=!L||for(k=1, #Str(n), sumdigits(n+=9)/9==k&&ok(n, L-1)&&return(n))); for(i=1, n, print1(s=a", "); until(s+sumdigits(a+=9)==a&&ok(a, L), )); a}
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Eric Angelini and M. F. Hasler, Oct 30 2014
STATUS
approved