Continued Fraction Expansions
Simple continued fractions, convergent recurrences and best-approximation properties, Lagrange's periodicity theorem, and the expansion of a square root used for Pell's equation…
Every page in the KEVOS library tagged Foundational Algorithms. 9 pages.
Simple continued fractions, convergent recurrences and best-approximation properties, Lagrange's periodicity theorem, and the expansion of a square root used for Pell's equation…
Computing exact integer square roots by Newton's method, fast rejection of non-squares by modular filters, and detection of perfect powers and prime powers.
Quadratic residues, Euler's criterion, the Legendre symbol, its Jacobi and Kronecker extensions, and the reciprocity-based algorithm that evaluates them in logarithmic time.
Left-to-right and right-to-left binary powering, sliding window exponentiation, addition chains, and the generic monoid formulation that makes one routine serve many algebraic s…
Representation of multiprecision integers, schoolbook and fast multiplication, division, modular reduction strategies, and how to choose the right base ring for a computation.
Root-finding modulo a prime: the gcd with x^p − x, equal-degree splitting by random shifts, and the special low-degree cases that admit closed forms.
Computing modular square roots: the p ≡ 3 (mod 4) shortcut, the Tonelli–Shanks algorithm and its 2-adic structure, and Cornacchia's algorithm for x² + dy² = p.
Euclid's algorithm and its worst case, the binary GCD, Lehmer's method for multiprecision operands, and how to choose between them by operand size.
The extended Euclidean algorithm, its loop invariants, half-extended variants, modular inversion, and rational reconstruction from a partial remainder sequence.