The Möbius function is a tool from number theory that answers a surprisingly simple question: given a positive integer, how many distinct prime factors does it have, and are any of those factors repeated? It assigns each integer a value of −1, 0, or 1 based on the answer.
Think of it as a "prime factor signature" that cares only about two things: whether the number is square-free (no prime squared divides it), and if so, whether the number of distinct primes is odd or even.
The Intuition First
Take any positive integer n. Factor it completely into primes:
n=p1a1p2a2⋯pkak
Now ask two yes/no questions:
Is any exponent ai≥2? That is, does any prime appear more than once in the factorization? If yes, the number is not square-free.
If the number is square-free, is the count k of distinct primes odd or even?
The Möbius function μ(n) encodes the answers:
If any prime repeats (ai≥2 for some i), then μ(n)=0.
If all primes appear exactly once (ai=1 for all i), then μ(n)=(−1)k, where k is the number of distinct primes.
So μ(n)=1 when n is square-free with an even number of prime factors, and μ(n)=−1 when n is square-free with an odd number of prime factors.
The Special Case: n=1
The number 1 has no prime factors at all. It is square-free by convention, and the number of distinct primes is k=0. Since (−1)0=1, we define:
μ(1)=1
This is not arbitrary — it makes the Möbius function work beautifully in sums and inversions, as you will see later.
The Precise Definition
μ(n)=⎩⎨⎧10(−1)kif n=1,if n is not square-free (some prime squared divides n),if n is square-free with exactly k distinct prime factors.
Worked Examples
n
Prime factorization
Square-free?
k
μ(n)
1
(none)
Yes
0
1
2
2
Yes
1
−1
3
3
Yes
1
−1
4
22
No
—
0
6
2⋅3
Yes
2
1
12
22⋅3
No
—
0
30
2⋅3⋅5
Yes
3
−1
210
2⋅3⋅5⋅7
Yes
4
1
Notice the pattern: μ(n) alternates sign with the parity of the number of distinct primes, but only when no prime repeats.
Why It Matters (A Glimpse)
The Möbius function is the key to Möbius inversion, a technique that lets you "undo" sums over divisors. If you have a function f(n) and define g(n)=∑d∣nf(d), then you can recover f from g using μ:
f(n)=∑d∣nμ(d)g(dn)
This is one of the most powerful identities in elementary number theory, used everywhere from prime number theory to combinatorics.
Watch out
A common mistake: do not confuse μ(n)=0 with "the number is prime." Many primes give μ(p)=−1, not 0. The value 0 means a prime squared divides n — so 4,8,9,12,16,18,20,… all have μ=0, but primes themselves never do.
Quick Check
What is μ(72)? Factor 72=23⋅32. Since 22 divides 72 (and so does 32), the number is not square-free. Therefore μ(72)=0.
What about μ(42)? Factor 42=2⋅3⋅7. All exponents are 1, so it is square-free with k=3 distinct primes. Hence μ(42)=(−1)3=−1.
The Möbius function μ(n) is 0 whenever n has a repeated prime factor, and (−1)k when n is square-free with k distinct prime factors, so each number here must first be factorised.
✓Final answer
μ(75)+μ(85)=0+1=1
75=3×52 is not square-free so μ(75)=0, while 85=5×17 has 2 distinct primes so μ(85)=1; the sum is 1.
The Möbius function is defined as
μ(n)=⎩⎨⎧1(−1)k0n=1n is a product of k distinct primes (square-free)n has a squared prime factor
where k = number of distinct prime factors.
Factorise 75:75=3×25=3×52. Since 52 divides 75, it is not square-free, so μ(75)=0.
Factorise 85:85=5×17. These are k=2 distinct primes and no square factor, so μ(85)=(−1)2=1.