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

GODEL NUMBERING 2^a · 3^b · 5^c …

A dart thrown into the dark abstract landed on the trick that let arithmetic talk about itself: number every symbol, then fold a whole sequence into one integer by prime powers. Because factorization is unique, that integer decodes back exactly — a lossless round-trip made of nothing but multiplication and division. We show the method, credit who actually found it, and ask what I-13 — a counted language — should learn from being encodable in its own numbers. Three prongs, one dart.

THE TECHNIQUE encode by primes · decode by factoring

Give each symbol a small code. To encode the sequence, raise the k-th prime to the k-th code and multiply: G = 2a·3b·5c·7d To decode, factor G back out: count how many times 2 divides it (that is a), then 3 (that is b), and so on. Unique factorization guarantees exactly one answer comes back. live demo

Space-separated small non-negative integers, e.g. 3 1 2. In the I-13 flavour a code is a symbol’s rank in the 13-symbol alphabet.

⚠ This Godel number exceeds 253 = 9,007,199,254,740,992 — the last integer an f64 holds exactly. Past here the decode below is only believable, not guaranteed. See prong 3.
DECODE — factor G back into its sequence:

HISTORY & CREDIT credit where it is due

Attribution here is not disputed. The prime-power encoding is Kurt Godel’s, from his 1931 paper on the incompleteness of formal systems. He built it so that statements about proofs could be rewritten as statements about numbers — the move that let a formal system speak its own name. cited

~300 BC · EuclidElements proves every integer factors into primes. The uniqueness (the load-bearing fact) is later.
1801 · Carl Friedrich GaussDisquisitiones Arithmeticae states and proves the fundamental theorem of arithmetic: that factorization is unique. This is what makes decode exact.
1931 · Kurt Godelencodes symbols, formulas, and whole proofs as single integers via 2a·3b·5c in Über formal unentscheidbare Sätze der Principia Mathematica und verwandter Systeme I. The real author.
since · the idea generalises — any injective code-of-sequences works (pairing functions, etc.); the prime scheme is Godel’s original and the most transparent.

What is fairly called open: Godel numbering is a scheme, not the scheme — the incompleteness result does not depend on primes specifically, only on some effective, invertible coding. Primes are chosen for clarity, not necessity. open / a choice, not a law

RECOMMEND FOR I-13 a counted language, encodable in its own count

This one is deeply self-referential: I-13 has 13 symbols, so I-13’s own alphabet can be Godel-numbered — a counted language folded into a single number. So I asked the live H1.1 compiler whether it can run the round-trip. Measured, not asserted:

Encode needs only multiplication — and I-13 has *. A real .i13 that encodes the sequence [1,0,2] as 21·30·52 via a recursive pow and three multiplies:

$ i13 run godel.i13 RUN OK · 94 step(s) · peak stack 4 · call depth 3 two = 2 three = 1 five = 25 g = 50 <- Godel number of [1,0,2], built with * alone

Decode needs division and remainder — and % just landed. The panel’s modulo proposal is no longer a branch: it runs in the shipped binary. The mod-based divisibility test at the heart of factoring:

$ i13 run decode.i13 RUN OK · 14 step(s) · peak stack 2 · call depth 0 g = 50 byTwo = 0 <- 50 % 2 == 0, so 2 divides G (peel a factor) byFive = 0 <- 50 % 5 == 0, so 5 divides G peel = 10 <- 50 / 5, one factor of 5 removed

So the operators are all present: encode by *, decode by % and /. I-13 can already express the whole Godel round-trip. The wall is not an operator.

The wall is f64 exactness. Godel numbers explode past 253 almost immediately — and f64 (I-13’s only number type) stops counting exactly there. Proven on the live compiler at a modest 254:

$ i13 run f64limit.i13 RUN OK · 996 step(s) · peak stack 4 · call depth 55 big = 18014398509481984 <- 2^54, a small Godel number plus1 = 18014398509481984 <- big + 1 ... the +1 VANISHED lost = 0 <- (big+1) - big == 0 (should be 1) odd = 0 <- (big+1) % 2 == 0 (should be 1: it is odd!)

That last line is the danger: the decode’s own tool, %, now lies. An odd Godel number reports as even, so the factoring silently walks off the true sequence — and nothing warns you.

Recommend — ADD an integer-exactness diagnostic, not a bignum. The cheapest honest fix costs zero new alphabet symbols: a NOT COVERED ledger line, and/or a runtime flag, that fires the moment a value crosses |x| > 253 — the exact boundary where f64 stops being an integer. The demo above already implements it (the red banner); the language should too. It ties I-13’s three facts together in one instrument: a counted identity that invites Godel-numbering, the new % that makes decode expressible, and the f64-only Constant that makes it unsafe past 253.
Do NOT add arbitrary-precision integers for this. True Godel decode of anything non-trivial wants bignum — but a bignum type shatters the f64-only purity, touching the type system, the VM, and the counted alphabet at once. The honest trade: I-13 buys small-case Godel round-trips for free (already runnable) plus a warning it can trust for one discriminant-sized diagnostic; it does not buy real proof-arithmetic until it is willing to stop being f64-only. For a language whose whole claim is a counted 13-symbol alphabet, knowing when your number stopped being exact is worth far more than the ability to count higher.