EditSafely

Generate Kolakoski Numbers

Calculate a sequence of Oldenburger-Kolakoski numbers. 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 Numbers

  1. 1. Choose the sequence length. Set How many terms to the number of Kolakoski values you want to see, starting from the beginning of the sequence.
  2. 2. Understand what the sequence describes. The Kolakoski sequence contains only 1s and 2s, and its own run-lengths reproduce the same sequence, a rare example of a self-describing run-length encoding.
  3. 3. Pick a separator. Set Separator to a comma or space so the run of 1s and 2s reads clearly, since the values themselves are only ever 1 or 2.
  4. 4. Copy the sequence. Copy the generated terms into a notebook or analysis script studying self-describing sequences and their unresolved density conjecture.

When to use Generate Kolakoski Numbers

Generate Kolakoski Numbers produces the Oldenburger-Kolakoski sequence, whose run-lengths of 1s and 2s describe themselves, a property mathematicians still cannot fully explain the long-term density of. Use it whenever you need concrete terms instead of re-deriving the self-referential run-length rule by hand.

  • Illustrating self-describing sequences. A math educator building a slide deck on self-referential structures wants the first thirty Kolakoski terms printed out to show how the run-lengths of 1s and 2s regenerate the same sequence.
  • Feeding a run-length density experiment. A hobby programmer studying the long-standing conjecture that 1s and 2s each appear with density one half wants a long generated sequence to feed into a frequency-counting script.
  • Validating a recursive generator. Someone implementing the Kolakoski construction recursively in Rust wants a trusted reference sequence of fifty terms to compare their output against, character by character.

Examples

The first fourteen numbers

Output

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

About the Generate Kolakoski Numbers tool

Generate Kolakoski Numbers runs as plain JavaScript in your browser tab, with no server behind it. Calculate a sequence of Oldenburger-Kolakoski numbers. Whatever you put in stays on your device from start to finish.

The tool is part of EditSafely's Number Tools section, 194 single-purpose utilities built around the same idea: open the page, get the result, keep your data to yourself.

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.

That local-first design has practical benefits beyond privacy. The tool keeps working on a flaky connection once the page has loaded, results are instant because nothing round-trips to a server, and it is safe to use with confidential material.

Frequently asked questions

Does Generate Kolakoski Numbers cost anything?

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?

No data leaves your device. The whole tool is JavaScript that runs inside your browser tab, so there is no upload, no server-side processing and no log of what you did. If you disconnect from the internet after the page loads, it keeps working.

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?

Nothing to install and no account needed. Open the page in any up-to-date browser, including on a phone or tablet, and the tool is ready.

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.