Concepts5
β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
β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
βοΈAlgorithmAdvanced
Subset Sum Convolution
Subset Sum Convolution (often called Subset Convolution) computes C[S] by summing A[T]ΓB[U] over all disjoint pairs T and U whose union is S.
#subset convolution#subset sum convolution#sos dp+11
βοΈAlgorithmAdvanced
Sum over Subsets (SOS) DP
Sum over Subsets (SOS) DP lets you compute F[mask] = sum of A[submask] over all submasks in O(n 2^n) instead of O(3^n).
#sos dp#subset zeta transform#mobius inversion+11