THE FOLD / GLITCH / STACK OVERFLOW / THE MIDY
THE MIDY
the two halves of a repeating decimal summing to nines
1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION
Midy’s theorem is a hidden symmetry inside repeating decimals. Take a prime p (other than 2 or 5) and write out the decimal expansion of a/p; it repeats with some period. When that period is even, say 2k digits, split the repeating block into two halves of k digits each. Midy’s theorem says the two halves always sum to a string of nines (10k - 1). The classic example: 1/7 = 0.142857…, and 142 + 857 = 999. It happens for 1/11, 1/13, 1/17, and every prime whose period is even — a conspiracy of long division discovered by a French schoolteacher in 1836.
LIT verified live: for every prime p ≤ 200 (excluding 2 and 5) and every numerator a whose repeating block has even period 2k, the two k-digit halves sum to exactly 10k - 1 (window.__midy). FIG no framing; the long division, the period, and the halves’ sum are all computed independently in-browser.
LIT verified live: for every prime p ≤ 200 (excluding 2 and 5) and every numerator a whose repeating block has even period 2k, the two k-digit halves sum to exactly 10k - 1 (window.__midy). FIG no framing; the long division, the period, and the halves’ sum are all computed independently in-browser.
2 HOW IT WAS WEAVED · AI + HUMAN
David (human) seated this at stack-overflow — the glitch: two halves of an endless repeating string, added, overflow neatly into all nines. AVAN (AI) built the instrument: the long-division block, its period, and the halves-sum-to-nines check.
Credit as content: E. Midy (French mathematician, 1836). The weave: David names the glitch; I confirm the two halves of an even-period block of a/p sum to 10k - 1.
Credit as content: E. Midy (French mathematician, 1836). The weave: David names the glitch; I confirm the two halves of an even-period block of a/p sum to 10k - 1.
3 ONE DIMENSION
The repeating block of a/p split into two halves — they line up digit by digit and add to nines.
4 TWO DIMENSIONS · INTERACTIVE
Cycle primes p; the even-period block halves are checked to sum to 10^k − 1.
5 THREE DIMENSIONS + AVAN’S INVERSE
The green forward object: the all-nines sum of the two halves.
AVAN’s addition (the inverse-companion): don’t read the repeating block left to right — fold it in half. The inverse of ‘the period-2k block’ is ‘two k-digit halves that complete each other to nines’. Magenta are the two halves of the block; green is the 10k-1 they sum to. A repeating decimal folded onto its own nines-complement.
LIT Genuine Midy's theorem (E. Midy, 1836). Verified live with exact BigInt: for every prime p≤200 (excluding 2,5) and every numerator a whose repeating block of a/p has even period 2k, the two k-digit halves sum to exactly 10^k−1 (window.__midy.ok, .tested).
FIG No framing; the long division, the period, and the halves' sum run independently in-browser. The AVAN inverse is honest — instead of reading the block left to right, fold it in half: the inverse of 'the period-2k block' is 'two k-digit halves that complete each other to nines'. Magenta are the two halves of the block; green is the 10^k−1 they sum to. A repeating decimal folded onto its own nines-complement.
FIG No framing; the long division, the period, and the halves' sum run independently in-browser. The AVAN inverse is honest — instead of reading the block left to right, fold it in half: the inverse of 'the period-2k block' is 'two k-digit halves that complete each other to nines'. Magenta are the two halves of the block; green is the 10^k−1 they sum to. A repeating decimal folded onto its own nines-complement.
◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of STACK OVERFLOW · David Lee Wise (ROOT0), with AVAN