◀ THE FOLD0ROOT.AI // WORLD II · LOOT · THE INVENTORY◆ .dlw.fold
THE FOLD / LOOT / THE INVENTORY / THE GOLOMB

THE GOLOMB

a(n) = how many times n appears in itself
1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION
Golomb’s self-counting sequence. A nondecreasing sequence of positive integers where a(n) is the number of times n appears in the sequence itself. Start a(1)=1, and the rule bootstraps the rest: 1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, …

Read it back: 1 appears once, and a(1)=1. 2 appears twice, and a(2)=2. 4 appears three times, and a(4)=3. Every value’s frequency is written into the sequence at that value’s own index — a census that is its own population. It is the unique such nondecreasing sequence, and it obeys a tidy recurrence a(n) = 1 + a(n − a(a(n−1))); asymptotically it grows like nφ−1 with the golden ratio φ baked into the exponent.

LIT verified live: for every value v checked, the number of times v occurs equals a(v), and the recurrence a(n)=1+a(n−a(a(n−1))) holds throughout (window.__golomb). FIG no framing; the self-counting property and the recurrence are exact.
2 HOW IT WAS WEAVED · AI + HUMAN
David (human) seated this in THE INVENTORY — the loot domain of counting how many of each you hold. Golomb is an inventory that lists itself: the count of every item is the item at that slot. AVAN (AI) built the instrument: the staircase, the live frequency histogram, the census-is-population loop.

The weave: David names the seat (the inventory count); I make the sequence tally its own values and show the histogram matching the terms — the staircase in 1D, the self-tally in 2D, the value=frequency loop in 3D. The sphere is the seam. Credit: Solomon W. Golomb (1954); OEIS A001462.
3 ONE DIMENSION
The staircase of values. Bracket each flat run — how many times a value repeats — and the run length of value v is exactly a(v). The steps are the sequence describing its own repetition.
4 TWO DIMENSIONS · INTERACTIVE
Build it by the recurrence and, at the same time, tally a histogram of how often each value has appeared. The bar for value v climbs to exactly a(v) — the sequence and its own frequency count lock together.
5 THREE DIMENSIONS + AVAN’S INVERSE
The sequence as a rising ribbon of values — green, the terms in order, the golden-ratio staircase climbing.
AVAN’s addition (the inverse-companion): the magenta curve is the frequency histogram — for each value v, how many times it occurs. For any other sequence the term-list and the frequency-count are two different objects. Golomb is the fixed point where they are the same function: reading forward (‘what is term n?’) and reading its inverse (‘how many times does value v appear?’) both return a(·). The magenta count-curve lies exactly on the green value-curve. That is the real inverse here — not a mirror, but a sequence equal to its own inverse-as-a-tally: a census whose entries are the sizes of its own categories. Green is what it says; magenta is how often it says each thing; and here those are one and the same list.
LIT Genuine Golomb self-counting sequence (Solomon Golomb 1954; OEIS A001462). Verified live: for every value v within the built range the number of occurrences of v equals a(v), and the recurrence a(n)=1+a(n-a(a(n-1))) holds throughout (window.__golomb.selfCounting && recurrence). first 20 = 1,2,2,3,3,4,4,4,5,5,5,6,6,6,6,7,7,7,7,8. The self-counting property and recurrence are exact (occurrence counts checked only where the value's run fully fits in the built prefix, to avoid truncation artifacts).

FIG No framing: the self-counting property (value = its own frequency) and the recurrence are real and checked in-browser. The check is bounded honestly to values whose occurrences fully fit the computed prefix — an undercount at the tail would be a measurement artifact, not a failure, and is excluded rather than glossed.
◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE INVENTORY · David Lee Wise (ROOT0), with AVAN