◀ THE FOLD0ROOT.AI // WORLD II · SPAWN · THE SANDBOX◆ .dlw.fold
THE FOLD / SPAWN / THE SANDBOX / THE MACMAHON BOX

THE MACMAHON BOX

every way cubes can settle into a corner
1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION
MacMahon’s box formula counts the ways to stack cubes into a corner. A plane partition in an a×b×c box is an a×b grid of heights, each between 0 and c, weakly decreasing along every row and every column — equivalently, a pile of unit cubes shoved into the corner of a box, settled under gravity from two directions at once. Percy MacMahon found that the number of such piles is a single closed product: PP(a,b,c) = ∏ₖ₋₁ᵀ ∏₌₋₁ᵇ ∏ₖ₋₁ᶜ (i+j+k−1)/(i+j+k−2). A tangle of nested inequalities collapses into one fraction of integers. The same number counts the lozenge tilings of a hexagon with sides a, b, c — the boxes-in-a-corner picture is the tiling, seen straight on.

LIT verified live by two independent routes agreeing exactly: a raw recursive enumeration that builds every legal height grid cell by cell, and the closed product formula evaluated in exact big integers. They match on every box tested — 1×1×1 = 2, 2×2×2 = 20, 3×3×3 = 980, 2×3×4 = 490, 4×4×3 = 24696, 4×4×4 = 232848 — and the formula’s symmetry under permuting a, b, c is checked directly (window.__macmahon). FIG no framing; the enumeration knows nothing about the formula, and the formula is computed as an exact integer ratio with the division verified to leave no remainder.
2 HOW IT WAS WEAVED · AI + HUMAN
David (human) seated this at the-sandbox — and it is literally one: a box, and every way the cubes can settle into its corner. AVAN (AI) built the instrument: the raw plane-partition enumerator, the exact big-integer product formula, the symmetry check, and the corner of stacked cubes itself.

Credit as content: Percy Alexander MacMahon (box formula, 1896–1916). The weave: David names the sandbox; I count the ways the cubes can fall two different ways and check the counts are the same number.
3 ONE DIMENSION
A plane partition as a height grid — weakly decreasing along every row and every column.
4 TWO DIMENSIONS · INTERACTIVE
Raw enumeration against the closed product formula, box shape by box shape.
5 THREE DIMENSIONS + AVAN’S INVERSE
The green forward object: the cubes actually stacked in the corner — one of PP(a,b,c) ways.
AVAN’s addition (the inverse-companion): do not enumerate the stackings — multiply the corners. The inverse of ‘walk every legal pile of cubes’ is ‘one product over the box’s own coordinates, (i+j+k−1)/(i+j+k−2)’. Magenta is the empty box the cubes fall into; green is the pile that settled. Seen straight on, the same pile is a lozenge tiling of a hexagon.
LIT Genuine MacMahon box formula for boxed plane partitions (Percy Alexander MacMahon, 1896–1916). Verified live: a raw recursive enumeration of every legal height grid and the exact big-integer product ∏∏∏ (i+j+k−1)/(i+j+k−2) agree on all 12 box shapes tested, including 4×4×4 = 232848 and 4×4×3 = 24696; the product's invariance under permuting a, b, c is checked on all six orderings of (2,3,4) (window.__macmahon.ok, .rows, .symmetric).

FIG No framing; the enumeration knows nothing about the formula, and the formula is computed as an exact integer ratio with the division verified to leave no remainder. The AVAN inverse is honest — instead of walking every legal pile of cubes, multiply over the box's own coordinates: the inverse of 'enumerate the stackings' is 'one product, (i+j+k−1)/(i+j+k−2)'. Magenta is the empty box the cubes fall into; green is the pile that settled.
◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE SANDBOX · David Lee Wise (ROOT0), with AVAN