# [seqfan] Re: Last term? (correction)

Andrew Weimholt andrew.weimholt at gmail.com
Mon Oct 26 05:25:40 CET 2015

```On Sun, Oct 25, 2015 at 2:04 PM, Eric Angelini <Eric.Angelini at kntv.be>
wrote:

>
> I guess S starts more like this:
>
> S=1,21,2,11,3,4,111,1122,5,6,7,8,9,22,23,22222,
> Slenghts=1  2  1  2 1  1   3    4    1  1  1 1 1  2,  2,  5
>
> S was always extended with the smallest
> integer not occuring earlier and not
>
> Note that S will show only nine 1's
> as there are only nine 1-digit integers
> in Z

More specifically, how does the concept of only showing nine 1's extend to
2's (and beyond)?
Do we count all the two digit numbers with no 0's and allow that many 2's
in the sequence,
or do we account for the fact that some two digit numbers with 1's will
become inaccessible?

Let's look at the base 5 version of this sequence...

After 1, 21, 2, 11, 3, 4, we have run out of 1's, so ostensibly the next
two terms should be 222, 2222
That's seven 2's, and we have the following two digit numbers left
{22,23,24,32,33,34,42,43,44} of which there are 9, so we should have enough
right?
But notice some of those two digit numbers also require 2's...

222 consumes 22,23,24, if we do not consider having any 2's in the next
term,
then...
22 will consume 32
23 will consume 33
24 will consume 34
32 will consume 42
42 will consume 43
We are left with 44 as the last available two digit number.
So we cannot have 2222 following 222. Let's then use 2333,
so our base-5 sequence becomes...

1, 21, 2, 11, 3, 4, 222, 2333, 22, 23, 24, 32, xxx, xxx, xxx, 33, 34, 42,
xxx, 43, xxxx, xxx, 44,
222 consumed 22,23,24
2333 consumed 32
22 consumed 33,34
23 consumed 42
24 consumed 43
32 consumed 44
42 has no two digit numbers left to consume, so either the sequence
terminates once we get to the point where the next term maps to the '2' in
42,
or we go back and try 3333 instead of 2333.
However, eventually, the same problem happens with the 3's, and so on,
so the dilemma really starts when you move beyond the first term, 1.

Andrew
```