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

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A261162 List run lengths of digits different from '2'. Lexicographically first such sequence of nonnegative numbers with no repeated terms. 1
1, 2, 0, 3, 22, 4, 5, 6, 20, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 21, 30, 12, 31, 33, 32, 34, 35, 36, 23, 37, 38, 39, 40, 41, 43, 44, 45, 46, 42, 47, 48, 49, 52, 50, 51, 53, 54, 24, 55, 56, 57, 58, 25, 59, 60, 61, 63, 62, 64, 65, 66, 67, 68, 72, 69, 70, 71, 73, 74, 75, 82, 76, 77, 78, 79, 80, 81, 83, 26 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
In the concatenation of all terms of this sequence, "12032245620...", consider the digits '2' as delimiters of chunks of other digits, "1", "03", "", "456", .... The lengths of these chunks are given by the terms of the sequence. At any point, the next term is the smallest number not occurring earlier and not leading to a contradiction.
LINKS
Eric Angelini, To reach the next "1", SeqFan list, August 10, 2015.
EXAMPLE
The sequence starts with a(1) = 1 digits different from '2'. (It cannot start with a(1) = 0 since this would require to start with a chunk of 0 digits different from '2', i.e., with a digit '2': contradiction.)
Then, the first '2' which occurs as a(2) = 2, must be followed by a(2) = 2 digits different from '2', and the smallest possible choices are a(3) = 0 and a(4) = 3.
The following digit '2', first digit of a(5), must immediately be followed by another digit '2' (because of a(3) = 0), thus a(5) = 22. (Since 2 already occurred earlier, a(5) = 2 followed by a(6) = 20 is not possible. The choice a(4) = 12 would be possible but lead to a lexicographically larger sequence, since they are compared term-wise and not digit-wise.)
Then follow a(4) = 3 other digits before the next '2' in a(9), etc.
PROG
(PARI) A261162(n=99, d=2, a=1, p=0, u=[-1], r=u)={for(n=2, n, print1(a", "); p+=#digits(a)+!a; r=concat(r, r[#r]+a+1); while(#r>1&&r[1]<p, r=r[2..-1]); u=setunion(u, [a]); while(#u>1&&u[2]==u[1]+1, u=u[2..-1]); for(k=u[1]+1, 9e9, setsearch(u, k)&&next; if(r[1] >= p+#dk=if(k, digits(k), [0]), setsearch(Set(dk), d)&&next, for(i=1, #dk, (dk[i]==d)==!setsearch(r, p+i-1)&&next(2))); a=k; next(2)); error); a}
CROSSREFS
Sequence in context: A135433 A223706 A347034 * A218862 A243199 A305212
KEYWORD
nonn,base
AUTHOR
Eric Angelini and M. F. Hasler, Aug 10 2015
STATUS
approved

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 April 24 00:30 EDT 2024. Contains 371917 sequences. (Running on oeis4.)