Imports

Chapter 31 — Number-Theoretic Algorithms

This is the canonical CLRS fourth-edition chapter guide during the migration period.

Current source

Sections 31.1--31.8 are native fourth-edition sections (elementary number-theoretic notions, the greatest common divisor, modular arithmetic, solving modular linear equations, the Chinese remainder theorem, powers of an element, the RSA public-key cryptosystem, and primality testing), imported directly under Chapter 31. The integer-factorization development (legacy Section 31.9) is retained as supplementary online material (reachable through CLRSLean.OnlineMaterial). Declarations keep their current namespaces; the third-edition-numbered imports CLRSLean.Chapter_31 and CLRSLean.Chapter_31.Section_31_* forward to these sources.

Implementation details

The supporting implementation pages remain available outside the main sidebar:

Coverage boundary

The native sections supply the represented fourth-edition number-theoretic sections (§31.1--31.8), including the executable cost layers: CLRS.Chapter31.modularLinearEquationSolver (§31.4), CLRS.Chapter31.modExpWithCount (§31.6), CLRS.Chapter31.rsaKeyGen and CLRS.Chapter31.rsaEncrypt/CLRS.Chapter31.rsaDecrypt (§31.7), and CLRS.Chapter31.millerRabinLoop (§31.8). §31.1 also carries the least-common-multiple layer (CLRS.Chapter31.gcd_mul_lcm_eq, CLRS.Chapter31.lcm_eq_mul_of_coprime), and §31.5 packages the Chinese remainder theorem as the ring isomorphism CLRS.Chapter31.zmod_chineseRemainder.

See docs/clrs-fourth-edition-map.csv for the section-level mapping and docs/migrations/clrs4.md for compatibility and deprecation policy.