Harman Patil (Editor)

Look and say sequence

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit
Look-and-say sequence

In mathematics, the look-and-say sequence is the sequence of integers beginning as follows:

Contents

1, 11, 21, 1211, 111221, 312211, 13112221, 1113213211, ... (sequence A005150 in the OEIS).

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

  • 1 is read off as "one 1" or 11.
  • 11 is read off as "two 1s" or 21.
  • 21 is read off as "one 2, then one 1" or 1211.
  • 1211 is read off as "one 1, one 2, then two 1s" or 111221.
  • 111221 is read off as "three 1s, two 2s, then one 1" or 312211.
  • The look-and-say sequence was introduced and analyzed by John Conway.

    The idea of the look-and-say sequence is similar to that of run-length encoding.

    If we start with any digit d from 0 to 9 then d will remain indefinitely as the last digit of the sequence. For d different from 1, the sequence starts as follows:

    d, 1d, 111d, 311d, 13211d, 111312211d, 31131122211d, …

    Ilan Vardi has called this sequence, starting with d = 3, the Conway sequence (sequence A006715 in the OEIS). (for d = 2, see  A006751)

    Growth

    The sequence grows indefinitely. In fact, any variant defined by starting with a different integer seed number will (eventually) also grow indefinitely, except for the degenerate sequence: 22, 22, 22, 22, … (sequence A010861 in the OEIS)

    Digits presence limitation

    No digits other than 1, 2, and 3 appear in the sequence, unless the seed number contains such a digit or a run of more than three of the same digit.

    Cosmological Decay

    Conway's cosmological theorem: Every sequence eventually splits ("decays") into a sequence of "atomic elements", which are finite subsequences that never again interact with their neighbors. There are 92 elements containing the digits 1, 2, and 3 only, which John Conway named after the natural chemical elements. There are also two "transuranic" elements for each digit other than 1, 2, and 3.

    Growth in Length

    The terms eventually grow in length by about 30% per generation. In particular, if Ln denotes the number of digits of the n-th member of the sequence, then the limit of the ratio L n + 1 L n exists and is given by

    where λ = 1.303577269034... (sequence A014715 in the OEIS) is an algebraic number of degree 71. This fact was proven by Conway, and the constant λ is known as Conway's constant. The same result also holds for every variant of the sequence starting with any seed other than 22.

    In his original article, Conway gives an incorrect value for this, incorrectly citing a computation by A.O.L. Atkin. The correct value was first computed by Ilan Vardi as described in his book ``Computational Recreation in Mathematica."

    Polynomial returning Conway's constant

    Conway's constant is the unique positive real root of the following polynomial: (sequence A137275 in the OEIS)

    x 71 x 69 2 x 68 x 67 + 2 x 66 + 2 x 65 + x 64 x 63 x 62 x 61 x 60 x 59 + 2 x 58 + 5 x 57 + 3 x 56 2 x 55 10 x 54 3 x 53 2 x 52 + 6 x 51 + 6 x 50 + x 49 + 9 x 48 3 x 47 7 x 46 8 x 45 8 x 44 + 10 x 43 + 6 x 42 + 8 x 41 5 x 40 12 x 39 + 7 x 38 7 x 37 + 7 x 36 + x 35 3 x 34 + 10 x 33 + x 32 6 x 31 2 x 30 10 x 29 3 x 28 + 2 x 27 + 9 x 26 3 x 25 + 14 x 24 8 x 23 7 x 21 + 9 x 20 + 3 x 19 4 x 18 10 x 17 7 x 16 + 12 x 15 + 7 x 14 + 2 x 13 12 x 12 4 x 11 2 x 10 + 5 x 9 + x 7 7 x 6 + 7 x 5 4 x 4 + 12 x 3 6 x 2 + 3 x 6

    Popularization

    The look-and-say sequence is also popularly known as the Morris Number Sequence, after cryptographer Robert Morris, and the puzzle "What is the next number in the sequence 1, 11, 21, 1211, 111221?" is sometimes referred to as the Cuckoo's Egg, from a description of Morris in Clifford Stoll's book The Cuckoo's Egg.

    Variations

    There are many possible variations on the rule used to generate the look-and-say sequence. For example, to form the "pea pattern" one reads the previous term and counts all instances of each digit, listed in order of their first appearance, not just those occurring in a consecutive block. Thus, beginning with the seed 1, the pea pattern proceeds 1, 11 ("one 1"), 21 ("two 1s"), 1211 ("one 2 and one 1"), 3112 (three 1s and one 2), 132112 ("one 3, two 1s and one 2"), 311322 ("three 1s, one 3 and two 2s"), etc. This version of the pea pattern eventually forms a cycle with the two terms 23322114 and 32232114.

    Other versions of the pea pattern are also possible; for example, instead of reading the digits as they first appear, one could read them in ascending order instead. In this case, the term following 21 would be 1112 ("one 1, one 2") and the term following 3112 would be 211213 ("two 1s, one 2 and one 3").

    These sequences differ in several notable ways from the look-and-say sequence. Notably, unlike the Conway sequences, a given term of the pea pattern does not uniquely define the preceding term. Moreover, for any seed the pea pattern produces terms of bounded length. This bound will not typically exceed 2 * radix + 2 digits and may only exceed 3 * radix digits in length for degenerate long initial seeds ("100 ones, etc"). For these maximum bounded cases, individual elements of the sequence take the form a0b1c2d3e4f5g6h7i8j9 for decimal where the letters here are placeholders for the digit counts from the preceding element of the sequence. Given that this sequence is infinite and the length is bounded, it must eventually repeat due to the pigeonhole principle. As a consequence, these sequences are always eventually periodic.

    References

    Look-and-say sequence Wikipedia