EditSafely

Generate Kolakoski Sequence

Create Oldenburger-Kolakoski values. Runs entirely in your browser, so your data never leaves your device.

Output

The result appears here as you type.

Options

How to use Generate Kolakoski Sequence

  1. 1. Set how many terms. Enter How many terms to decide the length of the Kolakoski sequence, the self-describing run of 1s and 2s where the sequence describes its own run lengths.
  2. 2. Set a separator. Choose Separator, a comma or newline, to control how the values are joined for your notes or a code comparison.
  3. 3. Copy the sequence. The tool builds the sequence so that reading off the lengths of consecutive equal runs reproduces the sequence itself. Copy the terms for your recreational math study.

When to use Generate Kolakoski Sequence

Generate Kolakoski Sequence produces the Oldenburger-Kolakoski sequence of 1s and 2s, a sequence that is its own run-length encoding. Reach for it whenever you need verified terms of this famously self-describing sequence for study or code testing.

  • Understanding run-length self-description. A student learning about run-length encoding wants to see a sequence that describes its own run lengths in action, and the Kolakoski sequence is the standard textbook example.
  • Testing a self-generating sequence builder. A developer who implemented the recursive construction of this sequence in code checks the first thirty or so terms against this tool's output to confirm the algorithm is correct.
  • Studying open questions in combinatorics. Someone researching why the density of 1s versus 2s in this sequence is still not proven to equal one half wants a long run of terms to inspect for patterns.
  • Comparing against similar automatic sequences. A researcher studying self-describing and automatic sequences generates Kolakoski terms alongside other examples like Golomb's sequence to compare their differing construction rules.

Examples

The first fourteen terms

Output

1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 2, 2, 1, 1

About the Generate Kolakoski Sequence tool

Generate Kolakoski Sequence does its work locally, right in the browser. Create Oldenburger-Kolakoski values. There is no upload step, no queue and no account, and your data never travels over the network.

It belongs to the Math Tools collection on EditSafely, a set of 234 small, focused Math utilities that share the same instant, private workspace.

You can shape the output with 2 settings, including How many terms and Separator, and the result refreshes the moment you change one. A worked example further down the page shows exactly what the tool produces for a real input.

Running locally also makes the tool fast and dependable: results appear as you type or drop a file, there is no server outage that can take it down mid-task, and confidential data can be processed without a second thought.

Frequently asked questions

Is Generate Kolakoski Sequence free to use?

Yes, it is completely free. All 2,658 tools on EditSafely work without an account, a subscription or usage limits.

Does the generator send anything to a server?

Everything happens locally. Your browser downloads the tool's code once, then does all the processing itself; nothing you enter is transmitted, stored or logged. You can even go offline after the page loads and it will still work.

How do I get a different result?

Run the generator again. Each run is computed fresh on your device, and any options you change are applied to the next result immediately.

Do I need to sign up or install anything?

No. The tool works in any modern browser on desktop, tablet or phone. There is no account to create, no extension to add and no software to install.

How do I use the result?

The output panel has a one-click copy button, and you can keep refining the input while you work; the result updates in place as you type.

Related tools

All Math Tools