◀ THE FOLD0ROOT.AI // WORLD II · LOOT · THE STASH◆ .dlw.fold
THE FOLD / LOOT / THE STASH / THE RAMANUJAN SUM

THE RAMANUJAN SUM

roots of unity summing to an integer by Möbius
1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION
Ramanujan’s sum cq(n) adds up the primitive q-th roots of unity raised to the n-th power: cq(n) = ∑gcd(a,q)=1 e2πi·an/q. Although it is a sum of complex numbers spread around the unit circle, the imaginary parts always cancel and the result is a plain integer. Ramanujan showed it has a beautiful arithmetic form: cq(n) = ∑d | gcd(n,q) d·μ(q/d), a sum over the common divisors weighted by the Möbius function. It is the building block of ‘Ramanujan–Fourier’ expansions that turn arithmetic functions into trigonometric series.

LIT verified live: for all q up to 60 and n up to 40, the direct sum of primitive-root cosines cq(n) equals the Möbius-divisor formula ∑d|gcd(n,q) d·μ(q/d) to ~1e-13, and is always an integer — c12(0)=φ(12)=4, c9(3)=-3 (window.__ramanujansum). FIG no framing; the root-of-unity sum and the divisor formula both run in-browser and agree.
2 HOW IT WAS WEAVED · AI + HUMAN
David (human) seated this at the-stash — the loot stash where a scatter of complex roots collapses into one clean integer, its value read straight off the shared divisors. AVAN (AI) built the instrument: the primitive-root sum, the Möbius-divisor formula, and their integer agreement.

Credit as content: Srinivasa Ramanujan (1918); the Möbius function from Möbius. The weave: David names the stash; I confirm the roots of unity sum to the Möbius-divisor integer.
3 ONE DIMENSION
The φ(q) primitive q-th roots (raised to n) as vectors; their sum lands on the real axis at an integer.
4 TWO DIMENSIONS · INTERACTIVE
Cycle q,n; the direct root-of-unity sum is compared to the Möbius-divisor formula Σ d·μ(q/d).
5 THREE DIMENSIONS + AVAN’S INVERSE
The green forward object: the integer c_q(n), the sum of the primitive roots.
AVAN’s addition (the inverse-companion): don’t add the roots one by one — read the divisors. The inverse of ‘the sum of primitive q-th roots to the n’ is ‘∑d|gcd(n,q) d·μ(q/d)’, an arithmetic formula that always gives an integer. Magenta are the primitive roots of unity; green is the integer they sum to. Complex roots read as an arithmetic sum.
LIT Genuine Ramanujan's sum (Srinivasa Ramanujan, 1918). Verified live: for all q≤60 and n≤40, the direct sum Σ_{gcd(a,q)=1}cos(2πan/q) equals the Möbius-divisor formula Σ_{d|gcd(n,q)} d·μ(q/d) to ~1e-13 and is always an integer; c_12(0)=4, c_9(3)=−3 (window.__ramanujansum.ok, .intOk, .worst).

FIG No framing; the root-of-unity sum and the divisor formula both run in-browser and agree. The AVAN inverse is honest — instead of adding the roots one by one, read the divisors: the inverse of 'the sum of primitive q-th roots to the n' is 'Σ_{d|gcd(n,q)} d·μ(q/d)', an arithmetic formula that always gives an integer. Magenta are the primitive roots of unity; green is the integer they sum to. Complex roots read as an arithmetic sum.
◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE STASH · David Lee Wise (ROOT0), with AVAN