Concepts105

MathAdvanced

Stirling Numbers of First Kind

Stirling numbers of the first kind count permutations by their number of cycles and connect power polynomials to rising/falling factorials.

#stirling numbers of the first kind#unsigned cycle numbers#signed stirling numbers+12
MathAdvanced

Stirling Numbers of Second Kind

Stirling numbers of the second kind S(n,k) count how many ways to split n labeled items into k non-empty, unlabeled groups.

#stirling numbers of the second kind#set partitions#bell numbers+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

Discrete Logarithm

The discrete logarithm problem asks for x such that g^x ≡ h (mod p) in a multiplicative group modulo a prime p.

#discrete logarithm#baby-step giant-step#pollard rho dlp+12
MathAdvanced

Pollard's Rho Factorization

Pollard's Rho is a randomized algorithm that finds a non-trivial factor of a composite integer by walking a pseudorandom sequence modulo n and extracting a factor with a gcd.

#pollard's rho#integer factorization#cycle detection+10
MathAdvanced

Quadratic Residues

A quadratic residue modulo an odd prime p is any a for which x^2 ≡ a (mod p) has a solution; exactly half of the nonzero classes are residues.

#quadratic residues#legendre symbol#euler criterion+12
MathAdvanced

Möbius Function and Inversion

The Möbius function μ(n) is 0 if n has a squared prime factor, otherwise it is (-1)^k where k is the number of distinct prime factors.

#mobius function#mobius inversion#dirichlet convolution+12
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
⚙️AlgorithmAdvanced

Sqrt Decomposition on Queries

Sqrt decomposition on queries (time blocking) processes Q operations in blocks of size about \(\sqrt{Q}\) to balance per-query overhead and rebuild cost.

#sqrt decomposition#time blocking#query blocking+12
⚙️AlgorithmAdvanced

Polynomial Operations

Fast polynomial operations treat coefficients like numbers but use FFT/NTT to multiply in O(n \log n) time instead of O(n^2).

#polynomial#ntt#fft+12
⚙️AlgorithmAdvanced

Parallel Binary Search

Parallel Binary Search (PBS) lets you binary-search the answers of many queries at once by batching them by their current mid value.

#parallel binary search#offline queries#monotone predicate+10
⚙️AlgorithmAdvanced

Convolution Applications

Convolution turns local pairwise combinations (like matching characters or adding two dice) into a single fast transform–multiply–inverse pipeline.

#convolution#fft#ntt+12