Möbius Function Calculator
Calculate the Mobius function for any integer: check squarefreeness, compute values for a range, and explore connections to the Riemann zeta function.
What Is the Möbius Function? The Möbius function μ(n) is a fundamental multiplicative function in number theory, defined as: μ(1) = 1. μ(n) = (−1)^k if n is the product of k distinct primes (squarefree). μ(n) = 0 if n has any squared prime factor (i.e., p² | n for some prime p). Named after August Ferdinand Möbius, German mathematician, 1832.
The Three Cases μ(n) = 1: n is squarefree with an even number of distinct prime factors. Examples: 1 (zero primes, and zero is even), 6 = 2×3, 10 = 2×5, 210 = 2×3×5×7. μ(n) = −1: n is squarefree with an odd number of distinct prime factors. Examples: 2, 3, 5 and every other prime (one factor each), 30 = 2×3×5, 105 = 3×5×7. μ(n) = 0: n is not squarefree, meaning some prime appears more than once. Examples: 4 (2²), 8 (2³), 9 (3²), 12 (2²×3), 18 (2×3²).
Count distinct primes, not repeats, and count them carefully. 30 is a common slip: it looks like a small friendly number but it carries three primes, so μ(30) = −1, not +1. Only the parity of that count matters, never the size of the primes involved.
Squarefreeness A number n is squarefree if no prime squared divides it. Squarefree: 1, 2, 3, 5, 6, 7, 10, 11, 13, 14, 15, … Non-squarefree: 4, 8, 9, 12, 16, 18, 20, 24, 25, … About 6/π² ≈ 60.8% of all positive integers are squarefree.
Key Properties Multiplicativity: if gcd(m,n) = 1, then μ(mn) = μ(m)μ(n). Sum over divisors: Σ_{d|n} μ(d) = 1 if n=1, else 0. This is used to prove many results in analytic number theory. Dirichlet series: Σ μ(n)/nˢ = 1/ζ(s), where ζ is the Riemann zeta function. This inverse relationship makes μ(n) central to the study of the zeta function.
Möbius Inversion Formula If f(n) = Σ_{d|n} g(d), then g(n) = Σ_{d|n} μ(d) f(n/d). This lets you “invert” sums over divisors, and it is used constantly in analytic number theory. Example: Euler’s totient φ(n) = Σ_{d|n} μ(d) × (n/d).
Connection to the Riemann Hypothesis The Mertens function M(x) = Σ_{n≤x} μ(n). The Riemann Hypothesis is equivalent to: M(x) = O(x^(1/2+ε)) for every ε > 0. In other words, the Möbius function “averages out” quickly if and only if the Riemann Hypothesis is true. The Mertens conjecture (|M(x)| < √x) was disproved in 1985, though the counterexamples are astronomically large.
Applications Counting primitive Pythagorean triples, squarefree numbers, and primitive roots. Inclusion-exclusion in combinatorics via the Möbius inversion formula. Signal processing: Möbius function appears in the study of cyclotomic polynomials.
How we build and check this calculator
This calculator runs entirely in your browser, so the numbers you enter stay on your device. The math behind it is written by hand and tested against worked examples and standard references before the page goes live.
SuperGlobalCalculator is independently built and maintained. See how we build and verify our calculators.