Staaarter

Generate Look-and-Say Sequence

Generates N iterations of the look-and-say sequence by repeatedly reading each term aloud as consecutive digit runs, turning "1" into "11", "11" into "21", "21" into "1211", and so on. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-08-05
By Staaarter Team
sequencescombinatorics

Overview

Introduction

The look-and-say sequence is one of the most famous "say what you see" sequences in recreational mathematics, popularized by John Conway's detailed analysis of its growth rate and digit properties.

This generator produces the sequence starting from the standard seed "1", applying the read-aloud rule iteration by iteration to build each successive term.

What Is Generate Look-and-Say Sequence?

The look-and-say sequence, cataloged as OEIS A005150, starts at "1" and generates each next term by describing the previous term's consecutive digit runs: their count followed by the digit itself.

The sequence runs 1, 11, 21, 1211, 111221, 312211, ..., read as "one 1", "two 1s", "one 2, one 1", "one 1, one 2, two 1s", and so on.

How Generate Look-and-Say Sequence Works

Starting from the seed term "1", the tool scans each term left to right, identifying runs of consecutive identical digits.

For each run, it writes the run's length followed by the digit itself, concatenating these pairs together to form the next term; this process repeats for the requested number of iterations.

When To Use Generate Look-and-Say Sequence

Use it for exploring self-referential "describe what you see" sequences in recreational mathematics, or as a companion to Kolakoski Sequence Generator and Gijswijt's Sequence Generator when studying related self-describing sequences.

It's also a popular subject for programming exercises, since implementing the run-length-encoding step cleanly is a common coding interview and teaching exercise.

Features

Advantages

  • Implements the exact standard rule popularized by Conway, matching the canonical OEIS A005150 sequence term for term.
  • Runs efficiently even at higher iteration counts, since building each term only requires a single linear scan of the previous one.
  • Clear, comma-separated output showing every intermediate term, not just the final one, so you can trace the growth step by step.

Limitations

  • Capped at 45 iterations. Term length grows by roughly 30% per step (Conway's constant), so terms beyond this point become excessively long strings that aren't practical to display.
  • Only supports the standard seed "1"; it doesn't accept a custom starting term.

Examples

First 6 terms of the look-and-say sequence

Input

6

Output

1, 11, 21, 1211, 111221, 312211

"21" becomes "1211" by reading it as one 2 followed by one 1; "1211" then becomes "111221" by reading one 1, one 2, two 1s.

Best Practices & Notes

Best Practices

  • Keep iteration counts modest, around 10-15, if you plan to read or copy the full output, since terms lengthen quickly beyond that.
  • Use a smaller iteration count first to manually verify the read-aloud rule on a couple of terms before trusting a longer run.

Developer Notes

The run-length step uses a simple two-pointer scan: for each position, it counts how many subsequent characters match the current digit, appends the count and digit to the result string, then advances the index past the full run, an O(n) pass per term.

Generate Look-and-Say Sequence Use Cases

  • Studying self-referential "describe what you see" sequences in recreational mathematics
  • Programming exercises and coding interview practice for run-length encoding logic
  • Demonstrating Conway's constant and exponential term-length growth in a math or CS classroom

Common Mistakes

  • Confusing this with simple run-length encoding of arbitrary text, the look-and-say sequence specifically re-applies the rule to its own previous output starting from "1", not an arbitrary input string.
  • Expecting digits above 3 to appear, they never do in the standard sequence starting from seed "1", a property Conway proved formally.

Tips

  • Try manually decoding one term back into its run-length pairs to build intuition before trusting the generator's later terms.
  • Compare growth rates against Kolakoski Sequence Generator, both are self-referential but the look-and-say sequence grows exponentially while Kolakoski's terms don't.

References

Frequently Asked Questions