mathematicskit.number_theory ============================ .. include:: /_generated/nav/number_theory.rst The extended Euclidean algorithm and modular inverses; fast modular exponentiation; primality testing (trial division, Miller-Rabin) and prime generation (sieve of Eratosthenes); the Chinese Remainder Theorem; continued-fraction expansion and best rational approximations; Euler's totient function and other multiplicative functions (Mobius, divisor-sum); and linear and Pell Diophantine equation solvers. Every algorithm is hand-rolled -- exact-integer number theory has no ``numpy``/``scipy`` equivalent. .. automodule:: mathematicskit.number_theory :members: :undoc-members: