login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 60, we have over 367,000 sequences, and we’ve crossed 11,000 citations (which often say “discovered thanks to the OEIS”).

Other ways to Give
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A248050 Lexicographically earliest increasing sequence such that a(n) equals the sum of digits of the terms up to and including a(n). 1

%I #49 Jan 02 2023 12:30:50

%S 0,9,18,27,36,45,54,63,72,81,99,108,117,126,135,144,153,162,171,180,

%T 198,207,216,225,234,243,252,261,279,297,306,315,324,333,342,351,360,

%U 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

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

%C 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.

%C 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.

%C There seems also to be no limit on the "look-ahead" required to avoid getting stuck by a bad choice.

%H M. F. Hasler, <a href="/A248050/b248050.txt">Table of n, a(n) for n = 0..1000</a>

%H E. Angelini, <a href="http://list.seqfan.eu/oldermail/seqfan/2014-October/013895.html">Cumulative sum of the digits used so far</a>, SeqFan mailing list, Oct 30 2014

%o (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}

%K nonn,base

%O 0,2

%A _Eric Angelini_ and _M. F. Hasler_, Oct 30 2014

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified December 2 09:50 EST 2023. Contains 367517 sequences. (Running on oeis4.)