

A248050


Lexicographically earliest increasing sequence such that a(n) equals the sum of digits of the terms up to and including a(n).


1



0, 9, 18, 27, 36, 45, 54, 63, 72, 81, 99, 108, 117, 126, 135, 144, 153, 162, 171, 180, 198, 207, 216, 225, 234, 243, 252, 261, 279, 297, 306, 315, 324, 333, 342, 351, 360, 378, 396, 405, 414, 423, 432, 441, 459, 477, 495, 504, 513, 522, 531, 540, 558, 576, 594, 603, 612, 621, 639, 657, 675, 693, 702, 711, 720, 738, 756, 774, 792
(list;
graph;
refs;
listen;
history;
text;
internal format)



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 "lookahead" required to avoid getting stuck by a bad choice.


LINKS



PROG

(PARI) a(n, a=0, L=19)={local(ok(n, L)=!Lfor(k=1, #Str(n), sumdigits(n+=9)/9==k&&ok(n, L1)&&return(n))); for(i=1, n, print1(s=a", "); until(s+sumdigits(a+=9)==a&&ok(a, L), )); a}


CROSSREFS



KEYWORD

nonn,base


AUTHOR



STATUS

approved



