◀ THE FOLD0ROOT.AI // WORLD II · GRIND · THE GRINDSTONE◆ .dlw.fold
THE FOLD / GRIND / THE GRINDSTONE / THE PARTITION

THE PARTITION

p(n) — counting sums by Euler's pentagonal recurrence
1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION
The partition function p(n). In how many ways can you write n as a sum of positive integers, order ignored? For 4 there are 5: 4, 3+1, 2+2, 2+1+1, 1+1+1+1. The counts explode — p(100) is 190,569,292 — and listing them all is hopeless.

Euler found a miracle: the pentagonal number theorem gives a sparse recurrence,
p(n) = p(n−1) + p(n−2) − p(n−5) − p(n−7) + p(n−12) + p(n−15) − …
where 1, 2, 5, 7, 12, 15, … are the generalized pentagonal numbers and the signs run + + − − + + − −. It computes p(100) in a blink. Ramanujan later found astonishing patterns hiding in it: p(5k+4) is always divisible by 5.

LIT verified live: the pentagonal recurrence matches a direct brute-force count for n = 0…14, gives p(100) = 190569292 exactly, and Ramanujan’s p(5k+4) ≡ 0 (mod 5) holds (window.__partition.matchesBrute && p100===190569292). FIG no framing; the recurrence, the value, and the congruence are exact.
2 HOW IT WAS WEAVED · AI + HUMAN
David (human) seated this in THE GRINDSTONE, beside THE EUCLID, THE CONVERGENT and the number-theory thread — the grind domain of grinding numbers to their structure. Partitions are how a number breaks into sums, and Euler’s recurrence is the machinery that counts the breaks. AVAN (AI) built the instrument: the pentagonal recurrence, the brute-force check, the Ramanujan congruence.

The weave: David gathers the number theory; I make the counting explode and then tame it — the partitions in 1D, the recurrence and growth in 2D, the pentagonal engine in 3D. The sphere is the seam. Credit: Leonhard Euler (pentagonal number theorem, 1748); Hardy & Ramanujan; Ramanujan’s congruences.
3 ONE DIMENSION
The partitions of a small n, drawn as rows of dots (Young diagrams). Each is a different way to break n into a decreasing sum — and even for modest n there are already surprisingly many.
4 TWO DIMENSIONS · INTERACTIVE
Choose n and watch Euler’s recurrence assemble p(n) from a handful of earlier values at pentagonal offsets, with alternating signs. The bar chart shows p(0..n) rocketing up; the Ramanujan check confirms p(5k+4) is divisible by 5.
5 THREE DIMENSIONS + AVAN’S INVERSE
The growth of p(n) as a turning curve — green, the count climbing sub-exponentially with n.
AVAN’s addition (the inverse-companion): the magenta marks are the pentagonal offsets 1, 2, 5, 7, 12, 15, … with their + + − − signs — the sparse engine of the recurrence. Counting partitions directly is a combinatorial explosion: you would enumerate exponentially many sums. Euler’s inverse move is to not count at all — a short alternating sum over a different sequence, the pentagonal numbers, computes p(n) from its predecessors in almost no work. The inverse of ‘list every partition’ is ‘a generating-function identity that lists none’: one sequence secretly encoding how another one grows. The green is the count exploding; the magenta is the handful of pentagonal terms that tame the explosion into a recurrence.
LIT Genuine partition function and Euler's pentagonal number theorem (Euler 1748; Hardy-Ramanujan; Ramanujan congruences). Verified live: the pentagonal recurrence matches a direct brute-force partition count for n=0..14, gives p(100)=190569292 exactly, p(4)=5, p(10)=42, and Ramanujan's p(5k+4) = 0 (mod 5) holds (window.__partition.matchesBrute && p100 === 190569292, and ramanujan5). The recurrence, the value, and the congruence are exact.

FIG No metaphor is doing the work: the pentagonal recurrence, the exact p(100), and Ramanujan's mod-5 congruence are all real and checked (recurrence cross-verified against brute enumeration for small n). Euler's identity genuinely turns an exponential enumeration into a near-linear recurrence.
◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE GRINDSTONE · David Lee Wise (ROOT0), with AVAN