## 2850.61 – 1, 2, 2, 1, 1, 2, 1, 2, 2 . . .

Consider this sequence of 1s and 2s:

$1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 2, 2, \ldots$

The sequence goes back and forth between 1s and 2s. And it generates itself! It works this way: The first term is 1 and that simply reflects that the sequence begins with a single 1. The second term is a 2. That dictates that after the initial 1, there shall be two 2s. There they are! Just look at the sequence: the second and third terms are 2s. After these 2s, it is time for some 1s. How many 1s? That is given by the next (i.e., the third) term of the sequence. Since the third term is a 2 there will be two 1s (namely, the fourth and fifth terms). And so on.

What is the 100th term?

## Solution

Do it! This is an exercise in concentration. If you fill in the first 100 terms, you will find that the 100th is a 2.

If you are interested, you can arrange the work on a spreadsheet. One such is shown below. Here is how this particular spreadsheet works. The first row of the spreadsheet merely counts the terms. The second row gives the actual terms The third row alternates between 1 and 2. This row tells the user which kind of entry (1 or 2) will be placed later in the sequence. The fourth row keeps tabs of how much of the sequence has been specified so far by adding the terms of the sequence so far.

For example, look at the fourth column in the spreadsheet, the column that reads down: 4, 1, 2, 6. The 4 indicates this is the column for the 4th term of the sequence; the 1 indicates that the 4th term actually is a 1; the 2 tells us that later in the sequence there will be 2 (just one 2 because of the 1); and the 6 tells where that single 2 will be.

Look ahead to the column headed 6. This column reads: 6 2 2 9. This column tells us that the sixth term is indeed 2, as predicted by the fourth column and this 2 is alone, as that column predicted. And this column also stipulates that the ninth term be a 2 and that the 2 in the ninth term will be the second of two 2s.

Look ahead to the column headed 9. This column reads: 9 2 1 14. This column tells us that the ninth term is indeed 2, as predicted by the sixth column and that this 2 is not alone but is the second of two consecutive 2s (terms eight and nine). The ninth column also stipulates that there will be a 1 in the fourteenth column and that this 1 will be the second of two 1s. Check that this is correct by looking at the column headed 14.

And so on. As a final example find the column that reads: 35 2 1 52. This says that the 31st term is 2 and predicts that the 52nd term will be the second of two 1s.

The value of the spreadsheet is that the first, third and fourth rows are calculated automatically by the spreadsheet. Unfortunately the second row has to be filled in by hand but instructions on how to do that are give by earlier entries in the spreadsheet. Thus when it comes time to fill in the value of term 52, we know it must be a 1 and the second of two 1s.

Finally, we only have to fill in the spreadsheet far enough so that it predicts the 100th term. this it does in the column that reads: 66 2 2 101 which tells us that term number 101 is the second of two 2s. It follows that the 100th term is 2.

OK, maybe it's easier just to write the terms out.