Groups
Category
Level
Modular arithmetic is arithmetic with wrap-around at a fixed modulus m, like numbers on a clock.
A modular inverse of a modulo m is a number a_inv such that a ร a_inv โก 1 (mod m).
Eulerโs Theorem says that if a and n are coprime, then a raised to the power ฯ(n) is congruent to 1 modulo n.
Fermat's Little Theorem says that for a prime p and integer a not divisible by p, a^{p-1} โก 1 (mod p).
Fast exponentiation (binary exponentiation) computes a^n using repeated squaring in O(log n) multiplications.
The Chinese Remainder Theorem (CRT) reconstructs an integer from its remainders modulo pairwise coprime moduli and guarantees a unique answer modulo the product.
The linear sieve builds all primes up to n in O(n) time by ensuring each composite is marked exactly once by its smallest prime factor (SPF).
Prime factorization expresses any integer greater than 1 as a product of primes raised to powers, uniquely up to ordering.
The Extended Euclidean Algorithm finds integers x and y such that ax + by = gcd(a, b) while also computing gcd(a, b).
The Sieve of Eratosthenes marks multiples of each prime to find all primes up to n in O(n log log n) time.
The greatest common divisor (gcd) of two integers is the largest integer that divides both without a remainder.
A linear basis for XOR is a compact set of at most W numbers (W = number of bits) that can generate every XOR value obtainable from a multiset of numbers.