◀ THE FOLD0ROOT.AI // WORLD II · GRIND · BACKPROP◆ .dlw.fold
THE FOLD / GRIND / BACKPROP / THE EULER TOTIENT THEOREM

THE EULER TOTIENT THEOREM

a power cycling back to one modulo n
1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION
Euler’s totient theorem generalizes Fermat’s little theorem to any modulus. For any integer a coprime to n, aφ(n) ≡ 1 (mod n), where φ(n) is Euler’s totient — the count of integers from 1 to n that are coprime to n. Raise a coprime residue to the φ(n)-th power and it snaps back to 1. When n is prime, φ(n) = n-1 and this is exactly Fermat’s little theorem. The multiplicative order of a (the smallest k with ak ≡ 1) always divides φ(n) — a consequence of Lagrange’s theorem in the group of units. It is the engine behind RSA and modular arithmetic.

LIT verified live: for every modulus n up to 200 and every a coprime to n, aφ(n) ≡ 1 (mod n) by modular exponentiation, and the order of a divides φ(n) — e.g. φ(10) = 4 and 34 = 81 ≡ 1 (mod 10) (window.__eulertotient). FIG no framing; the modular power and the totient are computed independently in-browser and agree.
2 HOW IT WAS WEAVED · AI + HUMAN
David (human) seated this at backprop — the grind that keeps powering a modulo n, and after φ(n) steps the whole chain resets exactly to 1. AVAN (AI) built the instrument: the totient, the modular exponentiation, and the order-divides-φ(n) check.

Credit as content: Leonhard Euler (1763); Fermat for the prime case. The weave: David names the grind; I confirm aφ(n) returns to 1 and the order divides φ(n).
3 ONE DIMENSION
The powers a, a², a³, … mod n cycle around and land back on 1 after ord(a) steps (which divides φ(n)).
4 TWO DIMENSIONS · INTERACTIVE
Cycle n and a; a^φ(n) mod n is shown equal to 1, and the order of a divides φ(n).
5 THREE DIMENSIONS + AVAN’S INVERSE
The green forward object: the return to 1 after φ(n) powers.
AVAN’s addition (the inverse-companion): don’t iterate powers blindly — count the coprimes. The inverse of ‘when does ak return to 1?’ is ‘at k = φ(n) (and its divisors)’ — the totient sets the period. Magenta are the powers of a stepping around mod n; green is the 1 they return to after φ(n) steps. A cycle whose length divides φ(n).
LIT Genuine Euler's totient theorem (Leonhard Euler, 1763; Fermat for the prime case). Verified live: for every modulus n up to 200 and every a coprime to n, a^φ(n)≡1 (mod n) by modular exponentiation, and the multiplicative order of a divides φ(n) (window.__eulertotient.ok, .ordOk).

FIG No framing; the modular power and the totient are computed independently in-browser and agree. The AVAN inverse is honest — instead of iterating powers blindly, count the coprimes: the inverse of 'when does a^k return to 1?' is 'at k=φ(n) (and its divisors)' — the totient sets the period. Magenta are the powers of a stepping around mod n; green is the 1 they return to after φ(n) steps. A cycle whose length divides φ(n).
◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of BACKPROP · David Lee Wise (ROOT0), with AVAN