Concepts10

MathIntermediate

Harmonic Lemma

The Harmonic Lemma says that the values of \lfloor n/i \rfloor only change about 2\sqrt{n} times, so you can iterate those value blocks in O(\sqrt{n}) instead of O(n).

#harmonic lemma#integer division trick#block decomposition+12
MathAdvanced

Pólya Enumeration

Pólya Enumeration Theorem generalizes Burnside’s Lemma by turning counting under symmetry into a polynomial substitution problem.

#pólya enumeration#cycle index#burnside lemma+12
MathAdvanced

Burnside's Lemma

Burnside's Lemma says the number of distinct objects up to a symmetry group equals the average number of objects fixed by each symmetry.

#burnside's lemma#cauchy-frobenius#polya enumeration+12
MathAdvanced

Primitive Roots

A primitive root modulo n is a number g that cycles through all units modulo n when you repeatedly multiply by g, so its multiplicative order equals \(\varphi(n)\).

#primitive root#multiplicative order#euler totient+10
MathAdvanced

Divisor Function Sums

Summing the divisor function d(i) up to n equals counting lattice points under the hyperbola xy ≤ n, which can be done in O(√n) using floor-division blocks.

#divisor function#euler totient#mobius function+11
MathIntermediate

Multiplicative Functions

A multiplicative function is an arithmetic function f with f(mn) = f(m)f(n) whenever gcd(m, n) = 1.

#multiplicative function#dirichlet convolution#mobius function+12
MathIntermediate

Euler's Totient Function

Euler's Totient Function φ(n) counts how many integers from 1 to n are coprime with n.

#euler totient#phi function#coprime count+12
MathIntermediate

Modular Inverse

A modular inverse of a modulo m is a number a_inv such that a × a_inv ≡ 1 (mod m).

#modular inverse#extended euclidean algorithm#fermats little theorem+12
MathIntermediate

Euler's Theorem

Euler’s Theorem says that if a and n are coprime, then a raised to the power φ(n) is congruent to 1 modulo n.

#euler totient#euler theorem#modular exponentiation+12
MathIntermediate

Fast Exponentiation

Fast exponentiation (binary exponentiation) computes a^n using repeated squaring in O(log n) multiplications.

#binary exponentiation#fast power#modular exponentiation+11