Since 2010 · Powering 2M+ tool runs every month
Since 2010
Add to Chrome

My Toolbox

Automatic Mode

No saved tools yet.

Go Premium
Related tools
Euler's Totient Function CalculatorPartition Function CalculatorPrime Factorization CalculatorPrime Factor CalculatorIs it a Prime Number?Goldbach Conjecture VerifierGroup Theory Order Calculator
Home Page > Math > Basic Math Operations

Möbius Function Calculator

Calculate the Mobius function for any positive integer, returning -1, 0 or +1 with full prime factorization, squarefree analysis, a step-by-step explanation, the Mertens function and a colour-coded heatmap of nearby integers.

Free to useNo sign-up requiredInstant Results
Möbius Function CalculatorTry it now — free ▼
Quick examples:
μ(
Enter any positive integer n ≥ 1 (up to 1013). Digits only — commas and spaces will be stripped.
μ(n) IS DEFINED AS
+1 if n is squarefree with even # of prime factors
−1 if n is squarefree with odd # of prime factors
0 if n has a squared prime factor
squarefree · even k squarefree · odd k not squarefree

Embed Möbius Function Calculator Widget

About Möbius Function Calculator

The Möbius Function Calculator computes \( \mu(n) \) for any positive integer n up to 1013. Enter a number and instantly see its μ-value (−1, 0, or +1), full prime factorization, squarefree badge, the Mertens function \( M(n) = \sum_{k=1}^{n}\mu(k) \), a color-coded heatmap of μ-values for nearby integers, and a complete step-by-step explanation. It is designed for number theory students, competitive math learners, and anyone exploring squarefree integers, Möbius inversion, or the Riemann zeta connection.

What Is the Möbius Function?

The Möbius function, denoted \( \mu(n) \), is defined on positive integers by:

$$\mu(n) = \begin{cases} +1 & \text{if } n = 1 \\ +1 & \text{if } n \text{ is squarefree with an even number of prime factors} \\ -1 & \text{if } n \text{ is squarefree with an odd number of prime factors} \\ \phantom{+}0 & \text{if } n \text{ has a squared prime factor (} p^2 \mid n \text{ for some prime } p\text{)} \end{cases}$$

Introduced by the German mathematician August Ferdinand Möbius in 1832, this deceptively simple function is one of the most important tools in analytic and multiplicative number theory. It is multiplicative: \( \mu(mn) = \mu(m)\mu(n) \) whenever \( \gcd(m, n) = 1 \).

The Three Cases at a Glance

+1
Squarefree · Even k
e.g. 1, 6=2·3, 10=2·5, 15=3·5, 21=3·7
−1
Squarefree · Odd k
e.g. 2, 3, 5, 7, 30=2·3·5, 42=2·3·7
0
Not Squarefree
e.g. 4=2², 8=2³, 9=3², 12=2²·3, 18=2·3²
Density
6/π² ≈ 60.8% of positive integers are squarefree

Values of μ(n) for Small n

nFactorizationμ(n)Why
11+1Base case (empty product)
22−11 prime · squarefree
33−11 prime · squarefree
40Divisible by 2²
55−11 prime · squarefree
62·3+12 primes · squarefree
77−11 prime · squarefree
80Divisible by 2²
90Divisible by 3²
102·5+12 primes · squarefree
122²·30Divisible by 2²
302·3·5−13 primes · squarefree
2102·3·5·7+14 primes · squarefree
23102·3·5·7·11−15 primes · squarefree

Key Identities and Theorems

NameFormulaSignificance
Divisor-sum identity\( \sum_{d \mid n} \mu(d) = [n = 1] \)μ is the Dirichlet inverse of the constant 1
Möbius inversion\( g(n) = \sum_{d \mid n} f(d) \iff f(n) = \sum_{d \mid n} \mu(d)\,g(n/d) \)Recovers f from its divisor sum g
Euler's totient link\( \varphi(n) = \sum_{d \mid n} \mu(d)\,\frac{n}{d} \)Expresses φ via μ
Riemann zeta\( \dfrac{1}{\zeta(s)} = \sum_{n=1}^{\infty} \dfrac{\mu(n)}{n^{s}} \)Links μ directly to the zeta function
Mertens function\( M(n) = \sum_{k=1}^{n} \mu(k) \)Its growth rate is equivalent to RH
Squarefree density\( \lim_{n \to \infty} \dfrac{Q(n)}{n} = \dfrac{6}{\pi^2} \)Q(n) counts squarefree ≤ n

How to Use the Möbius Function Calculator

  1. Enter a positive integer n into the input field. Values up to \(10^{13}\) are supported. Digits only — commas or spaces are automatically stripped.
  2. Click "Calculate μ(n)" (or pick a quick example). The tool runs trial-division factorization and determines μ in milliseconds.
  3. Read the hero card to see μ(n) as −1, 0, or +1 with a squarefree badge and the count of distinct primes ω(n).
  4. Study the prime factorization chips — each prime becomes a pill-shaped chip; red-bordered chips with a "!" marker indicate a squared factor (why μ = 0).
  5. Scan the μ heatmap of integers near n. Green cells are +1, purple cells are −1, gray cells are 0. Click any cell to recompute for that integer.
  6. Review the step-by-step solution showing the factorization, squarefree check, prime count, and the final application of \( \mu(n) = (-1)^k \).

Applications of the Möbius Function

Beyond pure number theory, μ(n) appears in combinatorics (cyclotomic polynomials, necklace counting, Lyndon words), cryptography (primitive root tests, some primality heuristics), physics (partition functions and the Witten zeta function), and computer science (inclusion-exclusion on divisor lattices, fast Möbius transform). Every time you need to "undo" a divisor sum or enforce squarefree constraints, μ is the key.

FAQ

What is the Möbius function μ(n)?
The Möbius function μ(n), introduced by August Möbius in 1832, is a number-theoretic function defined on positive integers. It takes three possible values: μ(n) = 1 if n = 1 or if n is a squarefree positive integer with an even number of distinct prime factors; μ(n) = −1 if n is squarefree with an odd number of distinct prime factors; and μ(n) = 0 if n has a squared prime factor (is not squarefree).
What does it mean for n to be squarefree?
A positive integer n is squarefree (also called square-free or quadratfrei) if no prime appears more than once in its prime factorization. Equivalently, n is not divisible by the square of any prime. For example, 30 = 2 × 3 × 5 is squarefree, but 12 = 2² × 3 is not, because 2² = 4 divides 12. The density of squarefree integers is exactly 6/π² ≈ 60.79%.
Why does μ(n) = 0 for non-squarefree n?
The Möbius function is designed to be zero whenever n has a repeated prime factor so it acts as a "multiplicative inclusion-exclusion" indicator. This definition makes μ the Dirichlet inverse of the constant-1 function, underpins the Möbius inversion formula, and ensures key identities like Σμ(d) = [n = 1] (where d ranges over divisors of n) hold. Without the zero case, these central theorems would break.
How is the Möbius function used in mathematics?
μ(n) is central to analytic number theory. It appears in the Möbius inversion formula (recovering f from its divisor sum), the identity 1/ζ(s) = Σ μ(n)/nˢ linking it to the Riemann zeta function, Euler's totient expression φ(n) = Σ μ(d)·(n/d), and counting squarefree integers. The Mertens function M(n) = Σ μ(k) for k ≤ n is conjectured to grow slowly; its behavior is tightly linked to the Riemann Hypothesis.
What is the Mertens function M(n)?
The Mertens function M(n) is the summatory function of the Möbius function: M(n) = μ(1) + μ(2) + … + μ(n). Despite μ(k) taking only three values, M(n) fluctuates irregularly — it is positive for small n, but eventually takes arbitrarily large negative and positive values. Proving M(n) = O(n^(1/2 + ε)) is equivalent to the Riemann Hypothesis. This tool displays M(n) alongside μ(n) when n ≤ 200,000.
Is the Möbius function multiplicative?
Yes. The Möbius function is multiplicative: μ(mn) = μ(m)·μ(n) whenever gcd(m, n) = 1. However, it is not completely multiplicative — for example, μ(4) = 0 but μ(2)·μ(2) = 1, so μ(4) ≠ μ(2)·μ(2). This distinction matters because μ's multiplicativity only holds for coprime arguments.
What is the largest n this calculator supports?
The calculator accepts n up to 10¹³. Factorization uses trial division up to √n and handles 13-digit numbers in well under a second for most inputs. Very large semiprimes (products of two near-equal primes) take the longest but remain responsive. The Mertens function M(n) is computed via a sieve only when n ≤ 200,000 to keep the response fast.
Why is μ(1) = 1?
The value μ(1) = 1 comes from treating 1 as the empty product of primes — it has zero distinct prime factors, and (−1)⁰ = 1. It is also required so that μ is multiplicative (μ(1·n) = μ(1)·μ(n) forces μ(1) = 1) and so that the Dirichlet identity Σμ(d) for d | n equals 1 exactly when n = 1.

Reference this content, page, or tool as:

"Möbius Function Calculator" at https://MiniWebtool.com/m-bius-function-calculator/ from MiniWebtool, https://MiniWebtool.com/

by miniwebtool team. Updated: 2026-04-18

You can also try our AI Math Solver GPT to solve your math problems through natural language question and answer.

Basic Math Operations:

Top & Updated:

Ceiling and Floor Function CalculatorError Function CalculatorGamma Function CalculatorView all →
Home Page > Math > Basic Math Operations > Möbius Function Calculator