◄ WORLD V · SONNY 5DART 348 · a helldive at the net

FIBONACCI CODING a self-synchronizing code whose every word ends in 11 — because Zeckendorf forbids it inside

Zeckendorf (dart 347) hands you a code for free. Write an integer in its non-consecutive Fibonacci form as bits — a 1 where a Fibonacci is used — and two consecutive 1s can never appear inside (that is exactly what “non-consecutive” means). So append a single extra 1, and every codeword ends in 11 — a pattern that occurs nowhere else. That 11 is an unambiguous terminator: a decoder just splits the stream at every 11. The code is self-synchronizing (a bit-flip corrupts one number, not the whole stream) and robust — and its terminator is the second 11 in David's puzzle.

THE TECHNIQUE Zeckendorf bits + a terminating 1 → every word ends in 11

The demo encodes a number via its Zeckendorf bits and appends the terminator — the 11 that appears nowhere inside: live demo


HISTORY & CREDIT Apostolico & Fraenkel, 1987

“A universal code needs a length field.” — Fibonacci coding needs only the pattern 11, which Zeckendorf guarantees is impossible inside a word, so it marks the end for free. cited

1987 · Alberto Apostolico & Aviezri Fraenkel — “Robust transmission of unbounded strings using Fibonacci representations.”
the trick · non-consecutive bits + a final 1 = a unique 11 delimiter.
the property · self-synchronizing — an error damages one codeword, not the stream after it.

The one bit-pair Zeckendorf outlaws becomes the mark that ends every word. A terminator made of a prohibition. Apostolico–Fraenkel 1987

RECOMMEND FOR I-13 the 11 terminator, on the compiler

On the canonical compiler, the terminator is binary 11 = 3, and it is forbidden inside any Zeckendorf word — so it marks the end unambiguously:

$ i13 run g_fibonaccicoding.i13 # the 11 terminator RUN OK · 12 step(s) · peak stack 2 · call depth 0 terminator = 3 -- binary 11 is_three = 1 forbidden_inside = 1 -- Zeckendorf guarantees no 11 appears within a word
Recommend: Fibonacci coding is Zeckendorf's gift — the non-consecutive property (no 11 inside) turns a single appended 1 into a free, unambiguous terminator, and the code self-synchronizes. i13 grounds the terminator as binary 11. Not a keeper on its own (it inherits the keeper shot's mechanism), but the dart that pays off David's ~~11~~11~~: the first 11 is Lucas (dart 344), the second is this terminator — both born of the same non-consecutive law.