Why it matters
Möbius inversion solves counting problems with divisor constraints. Powerful technique.
Advertisement
The architecture
mu(n) = 0 if n has squared prime factor.
Otherwise: (-1)^k for k distinct primes.
Advertisement
How it works end to end
Precompute via sieve.
Inversion: if f(n) = sum g(d) for d|n, then g(n) = sum mu(n/d) f(d).
Applications: counting coprime pairs.