◀ THE FOLD0ROOT.AI // WORLD II · CHEAT · THE ROOT KIT◆ .dlw.fold
THE FOLD / CHEAT / THE ROOT KIT / THE CARMICHAEL

THE CARMICHAEL

a composite that fools the Fermat test to every base
1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION
Carmichael numbers are composites that perfectly impersonate primes. Fermat’s test says: if n is prime, then an−1 ≡ 1 (mod n) for every base a coprime to n — so a single failing base exposes a composite. A Carmichael number has no failing base at all: it passes Fermat’s test for every coprime a, despite being composite.

The smallest is 561 = 3×11×17. Korselt’s criterion pins them exactly: n is Carmichael if and only if it is squarefree and (p−1) divides (n−1) for every prime factor p. There are infinitely many (proved in 1994). Even 1729, the famous Hardy–Ramanujan taxicab number, is one. They are the reason serious primality testing abandoned Fermat’s test for the stronger Miller–Rabin test — which Carmichael numbers cannot fool.

LIT verified live: 561, 1105, 1729, 2465, 2821 all satisfy Korselt and pass Fermat’s test to every coprime base, an ordinary composite (15) does not, and Miller–Rabin base 2 unmasks 561 where Fermat is fooled (window.__carmichael). FIG no framing; the impersonation, Korselt’s criterion, and the Miller–Rabin unmasking are exact.
2 HOW IT WAS WEAVED · AI + HUMAN
David (human) seated this in THE ROOT KIT — the cheat domain of a thing disguised as trusted system. A Carmichael number is a rootkit in number theory: a composite wearing a prime’s credentials so completely that Fermat’s test never raises an alarm. AVAN (AI) built the instrument: the all-bases scan, the Korselt breakdown, the Fermat-vs-Miller-Rabin inverse.

The weave: David names the seat (the perfect disguise); I make a composite pass every Fermat base and then show the stronger test that catches it — the base line in 1D, the witness scan in 2D, the necessary-vs-sufficient inverse in 3D. The sphere is the seam. Credit: Robert Carmichael (1910); Korselt’s criterion (1899); infinitude by Alford, Granville & Pomerance (1994).
3 ONE DIMENSION
Every base a tested against 561: compute a560 mod 561. For a genuine prime this returns 1 for all a; for 561 it also returns 1 for every coprime base — a wall of green with no witness in sight, though 561 is composite.
4 TWO DIMENSIONS · INTERACTIVE
Pick a candidate and scan every base. Green = passes Fermat (looks prime), red = a witness proving compositeness. A Carmichael number shows all green among coprime bases; an ordinary composite lights up red witnesses everywhere. The Korselt check explains why.
5 THREE DIMENSIONS + AVAN’S INVERSE
The bases fanning around 561, all reporting “prime” — the green forward test: prime ⇒ passes Fermat, run in reverse as if passing meant prime.
AVAN’s addition (the inverse-companion): the magenta is the Miller–Rabin test, and it is exactly where the broken inverse gets repaired. Fermat’s test is a necessary condition read backwards as if it were sufficient — and a Carmichael number is the total failure of that inverse: every base falsely certifies it prime. Miller–Rabin strengthens the test by also checking the square roots of 1 along the way, and a Carmichael number can no longer hide: base 2 alone produces a genuine witness to 561’s compositeness. So the green Fermat fan is unanimously fooled; the single magenta Miller–Rabin probe is not. The inverse of ‘primes pass’ is safe to run only with the stronger test — the lesson that a necessary condition, no matter how many bases confirm it, is never a proof. Green is the disguise everyone believes; magenta is the one closer look that sees through it.
LIT Genuine Carmichael numbers (Robert Carmichael 1910; Korselt's criterion 1899; infinitude by Alford, Granville & Pomerance 1994). Verified live: 561, 1105, 1729, 2465, 2821 all satisfy Korselt (squarefree, (p-1)|(n-1)) and pass Fermat's test for every coprime base, an ordinary composite 15 does not, and Miller-Rabin base 2 produces a composite witness for 561 where Fermat is fooled (window.__carmichael.allCarmichael && foolFermatAllBases && millerRabinCatches561). The impersonation and the unmasking are exact.

FIG No framing: the all-bases Fermat impersonation, Korselt's criterion, and the Miller-Rabin unmasking are real and checked in-browser by exhaustive base scan and an actual strong-test witness. The necessary-vs-sufficient lesson (a Carmichael is the total failure of reading Fermat's necessary condition as sufficient; Miller-Rabin repairs it) is the honest content, demonstrated not asserted.
◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE ROOT KIT · David Lee Wise (ROOT0), with AVAN