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.

Möbius 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, 6 (=2×3), 30 (=2×3×5), 210 (=2×3×5×7). μ(n) = −1: n is squarefree with an odd number of distinct prime factors. Examples: 2, 3, 5, 30, wait — 2 (1 prime), 6 = wait, 6=2×3 (2 primes → +1), 30=2×3×5 (3 primes → −1). μ(n) = 0: n is NOT squarefree — has a prime squared as factor. Examples: 4 (2²), 8 (2³), 9 (3²), 12 (2²×3), 18 (2×3²).

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 — 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 — but counterexamples are astronomical.

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.


Embed This Calculator

Copy the code below and paste it into your website or blog.
The calculator will work directly on your page.