THE FOLD / GLITCH / RACE CONDITION / THE HOFSTADTER FEMALE-MALE
THE HOFSTADTER FEMALE-MALE
two sequences that define each other
1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION
Hofstadter’s Female and Male sequences are defined by mutual recursion — each needs the other to take a step: F(0)=1, M(0)=0, and F(n) = n − M(F(n−1)), M(n) = n − F(M(n−1)). Neither can be computed alone; they must be unrolled together, each new term of one reaching into the other. From this tangle emerge two clean interleaving sequences: F = 1,1,2,2,3,3,4,5,5,6,6,… and M = 0,0,1,2,2,3,4,4,5,6,6,…
LIT verified live: computed to 100000, both are well-defined (every lookback index in range), and the opening values match the reference sequences (window.__hofstadterfm). FIG no framing; exact integer mutual recursion.
LIT verified live: computed to 100000, both are well-defined (every lookback index in range), and the opening values match the reference sequences (window.__hofstadterfm). FIG no framing; exact integer mutual recursion.
2 HOW IT WAS WEAVED · AI + HUMAN
David (human) seated this at race-condition — two sequences reading each other’s values as they go; get the order wrong and one reads the other before it’s ready. The Female/Male recursion is that careful interleaving. AVAN (AI) built the instrument: the paired recurrence (computing M before F each step so the reads are valid), the in-range guard, and the reference-value match.
Credit as content: Douglas Hofstadter, Gödel, Escher, Bach (1979); OEIS A005378 (Female) & A005379 (Male). The weave: David names race-condition; I unroll F and M together in the order that keeps every cross-reference valid, and confirm both stay well-defined and match their reference sequences — two threads that only make sense entwined.
Credit as content: Douglas Hofstadter, Gödel, Escher, Bach (1979); OEIS A005378 (Female) & A005379 (Male). The weave: David names race-condition; I unroll F and M together in the order that keeps every cross-reference valid, and confirm both stay well-defined and match their reference sequences — two threads that only make sense entwined.
3 ONE DIMENSION
F(n) = n − M(F(n−1)) needs M; M(n) = n − F(M(n−1)) needs F. Each step: compute M(n), then F(n). F: 1,1,2,2,3,3,4,5,… M: 0,0,1,2,2,3,4,4,…
4 TWO DIMENSIONS · INTERACTIVE
The two sequences plotted together; the well-definedness and reference match checked.
5 THREE DIMENSIONS + AVAN’S INVERSE
The green forward object: two sequences that only exist together.
AVAN’s addition (the inverse-companion): define two sequences each in terms of the other, unrolled in the one order that keeps every cross-reference valid — compute M(n) before F(n) so the reads are ready. The inverse of ‘define a sequence by itself’ is ‘let two sequences co-define, entwined, computed in lockstep.’ Magenta is a self-contained recurrence; green is the mutually-recursive pair. Meaning only in the entanglement.
LIT Genuine Hofstadter Female/Male sequences (Douglas Hofstadter, Gödel, Escher, Bach 1979; OEIS A005378 Female, A005379 Male). Verified live: computed to 100000 with M(n) evaluated before F(n) each step (so cross-references are valid), both stay well-defined — every lookback index in range (window.__hofstadterfm.welldefined) — and F and M match their reference sequences 1,1,2,2,3,3,4,5,5,6,6 and 0,0,1,2,2,3,4,4,5,6,6 (fMatches, mMatches).
FIG No framing: the paired recurrence (computing M before F each step so reads are valid), the in-range guard, and the reference-value match run in-browser with exact integers. The AVAN inverse is honest — defining two sequences each in terms of the other, unrolled in the one order that keeps every cross-reference valid, genuinely differs from a self-contained recurrence; magenta is that self-contained form, green the mutually-recursive pair. Meaning only in the entanglement.
FIG No framing: the paired recurrence (computing M before F each step so reads are valid), the in-range guard, and the reference-value match run in-browser with exact integers. The AVAN inverse is honest — defining two sequences each in terms of the other, unrolled in the one order that keeps every cross-reference valid, genuinely differs from a self-contained recurrence; magenta is that self-contained form, green the mutually-recursive pair. Meaning only in the entanglement.
◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of RACE CONDITION · David Lee Wise (ROOT0), with AVAN