All Tools
Categories
Number Tools 69 XML Tools 64 Email Marketing Tools 55 Import-Export Tools 50 JSON Tools 45 Text Tools 13 Shipping Freight Tools 5 Calculator 4
About Contact Privacy

Kolakoski Numbers Generator

Generate Kolakoski (Oldenburger-Kolakoski) numbers - the self-describing 1-2 sequence 1, 2, 2, 1, 1, 2, 1, 2, 2, 1... where runs describe the sequence itself. Indexed rows, run stats, copy or download. Runs in your browser. Free.

Parameters
10 - 50,000
The runs of the sequence have lengths equal to the sequence itself. Stats show longest streak and the 1s ratio targeted by the open conjecture.
Sequence

          

About Kolakoski Numbers Generator

Write runs of 1s and 2s so that the run lengths are the sequence itself, in order: the Kolakoski sequence starts 1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 2, 2, 1, 1, 2, 1, 1, 2, 2, 1... Its runs have lengths 1, 2, 2, 1, 1, 2, 1, 2, 2, 1 — exactly the same digits. A sequence that describes its own runs, discovered by Oldenburger in 1939 and reinvented by Kolakoski in 1966.

Kolakoski Numbers Generator builds the sequence deterministically: each run length is dictated by the very digits being written. Choose a term count up to 50,000; rows show indexed blocks of digits; the stats line reports the run count, longest streak and the 1s ratio — the quantity the famous Kolakoski conjecture is about.

Features

  • Self-describing runs: The run lengths literally are the sequence — the generator consumes the digits it produces.
  • Linear generation: Up to 50,000 terms in one pass with simple array operations.
  • Indexed rows: Blocks of ten digits with index headers for easy reference.
  • Run statistics: Run count, longest streak of equal digits, and the 1s ratio in the prefix.
  • Copy or download: The plain digit string exports in one click.
  • Reference tab: The definition, the open density conjecture, and Oldenburger history.
  • Free and private: Everything runs locally — nothing is uploaded, stored or logged.

How to Use

  1. Set the term count — how many digits of the sequence (10 to 50,000).
  2. Generate — indexed digit rows appear instantly.
  3. Check self-description — strip the digits into runs and note their lengths match the digits themselves.
  4. Read the stats — the 1s ratio approaches the conjecture quantity as the prefix grows.
  5. Copy or download — the digit string for further analysis.

Examples

Example 1 — The definition in action. Generate 30 digits: the runs are 1, 22, 11, 2, 1, 22, 11, 2, 11, 2, 1... and the run lengths 1, 2, 2, 1, 1, 2, 1, 2, 2, 1... reproduce the sequence.

Example 2 — No long runs. Generate 200 digits and check the stats: the longest streak never exceeds 4 (the sequence contains no 11111 or 22222 — a proven fact).

Example 3 — The density guess. Generate 5,000 digits and read the 1s ratio: it hovers near 0.5 but never settles exactly — the object of the Kolakoski conjecture.

Example 4 — Run the reverse check. Copy the digits, re-read them as run lengths from the start, and compare in your editor: the run-length list equals the digit list.

Example 5 — Compare prefixed variants. The sequence can start with 1 or 2; generate the same count both ways and observe the mirrored structure of the two runs.

Benefits

  • Deterministic construction: The digit stream is forced by itself — no randomness anywhere.
  • Conjecture gateway: The 1s ratio statistic puts a genuinely open problem one click away.
  • Fast and large: 50,000 terms render instantly in the browser.
  • Teaching-ready: Indexed rows make run analysis and self-description checks trivial.
  • Export freedom: Plain digit strings paste into anything that consumes sequences.
  • Private by design: Every digit is computed locally; nothing leaves the machine.

Frequently Asked Questions

What is the Kolakoski sequence?
The sequence over {1, 2} that is its own run-length encoding: the lengths of its runs, in order, reproduce the sequence itself. It begins 1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 2, 2, 1, 1, 2, 1, 1, 2, 2, 1... with runs of lengths 1, 2, 2, 1, 1, 2, 1, 2, 2, 1... — the same list.
Who found it first?
Reinhold Oldenburger published it in 1939; William Kolakoski reinvented it in 1966 — hence the doubled name. The curious thing Oldenburger noticed is that the sequence describes its own runs, which is what makes it "self-describing".
How is it generated?
The generator alternates symbols 1 and 2 and writes runs whose lengths are dictated by the sequence itself: position 1 says the second run has length 2, so two 2s are written, then position 2 says the next run has length 2 of 1s, and so on. The rule produces the sequence deterministically.
What is the famous conjecture?
It is not known whether the symbol 1 occurs with limiting frequency exactly 1/2. Huge prefix computations support the guess but no proof exists; the sequence also is not known to be recurrent — whether every finite block appears.
What is in the output?
The sequence is written in rows of a(0) to a(9), a(10) to a(19)... with an index header on each row, plus run statistics: number of runs, longest streak and the 1s ratio in the generated prefix. Copy and Download hold the plain digit sequence.
How many terms can I generate?
Up to 50,000 in the browser with instant rendering. The linear-time construction makes even the full run cheap.
Is anything stored or uploaded?
No. The sequence is built locally by simple array pushes. Nothing is sent to a server, saved or logged. Copy or download before closing the tab.