# Tag

Sort by:

### Kolakoski sequence

The self-describing sequence consisting of "blocks" of single and double 1s and 2s, where a "block" is a single digit or pair of digits that is different from the digit (or pair of digits) in the preceding block. To construct the sequence, start with the single digit 1 (the first "block"). Here, the single 1 means that block of length one follows the first block. Therefore, require that the next block is 2, giving the sequence 12.Now, the 2 means that the next (third) block will have length two, so append 11 and obtain the sequence 1211. We have added two 1s, so the fourth and fifth blocks have length one each, giving 12112 and then 121121. As a result of adding 21, we obtain 121121221. As a result of adding 221, we obtain 12112122122112, and so on, giving the sequence 1, 2, 1, 1, 2, 1, 2, 2, 1, 2, 2, 1, 1, 2, ... (OEIS A006928). The sequence after successive iterations is given by 1, 12, 1211, 121121, 121121221, ..., and the lengths..

Check the price