The Kolakoski sequence is an infinite sequence of symbols {1,2} that is its own “run-length encoding“. It is named after mathematician Willian Kolakoski who described it in 1965, but further research shows that it was first discussed by Rufus Oldenburger in 1939.

This self-describing sequence consists of blocks of single and double 1s and 2s. Each block contains digits that are different from the digit in the preceding block.

To construct the sequence, start with 1. This means that the next block is of length 1. So we require that the next block is 2, giving the sequence 1, 2. Continuing this infinitely gives us the Kolakoski sequence: 1, 2, 1, 1, 2, 1, 2, 2, 1, 2, 2, 1, 1, 2, etc.

To generate the next number in the sequence from the previous term, read off the digits of the previous number, counting the number of digits in groups of the same digit. For example:

1 is read as ‘one 1’ = 11

11 is read as ‘two 1s’ = 21

21 is read as ‘one 2, one 1’ = 1211

If we start with any digit x from 0 to 9, then x will remain the last digit of the sequence. When x does not equal 1, the sequence is as follows:

The Conway sequence, named by Vardi in 1991, is a look-and-say sequence with the starting digit 3.

Growth in Length and Conway’s Constant

The terms of the sequence eventually grow in length about 30% per generation. If L_{n} denotes the number of digits in the n-th term of the sequence, the limit of the ratio

is Conway’s constant:

where λ = 1.303577269034…

Conway’s constant is the unique positive real root of the following polynomial:

Let me know if you’re enjoying these Math Bites? M x