μ(1) and M(1)
The integer 1 has no prime factors. By definition, μ(1) = 1, so the first summatory value is M(1) = 1.
Digits may include commas, spaces, or underscores as grouping separators. Decimals, zero, and negative integers are not accepted.
Try 30 to see μ(30) = −1 because 30 is the product of three distinct primes, and M(30) = −3.
The Möbius function μ(n) records whether a positive integer is square-free and the parity of its number of distinct prime factors. If n = p1p2⋯pk is square-free, then μ(n) = (−1)k. If any prime exponent is 2 or greater, μ(n) = 0. By definition, μ(1) = 1.
Möbius function: μ(n) = 1 if n = 1; μ(n) = (−1)k if n is a product of k distinct primes; μ(n) = 0 otherwise.
Mertens function: M(n) = ∑1 ≤ k ≤ n μ(k)
The Mertens function is the running total of Möbius values. Because terms with μ(k) = 0 do not change the sum, M(n) equals the number of square-free integers up to n with an even number of prime factors, including 1, minus the number with an odd number.
The integer 1 has no prime factors. By definition, μ(1) = 1, so the first summatory value is M(1) = 1.
12 = 22 × 3. Since the squared prime 22 divides 12, it is not square-free and μ(12) = 0.
30 = 2 × 3 × 5 is square-free with three distinct prime factors. Therefore μ(30) = (−1)3 = −1.
35 = 5 × 7 is square-free with two distinct prime factors. Therefore μ(35) = (−1)2 = 1.
| n | Factorization | μ(n) | M(n) |
|---|---|---|---|
| 1 | 1 | 1 | 1 |
| 2 | 2 | −1 | 0 |
| 3 | 3 | −1 | −1 |
| 4 | 22 | 0 | −1 |
| 5 | 5 | −1 | −2 |
| 6 | 2 × 3 | 1 | −1 |
| 7 | 7 | −1 | −2 |
| 8 | 23 | 0 | −2 |
| 9 | 32 | 0 | −2 |
| 10 | 2 × 5 | 1 | −1 |
Only −1, 0, and 1. A zero identifies a number divisible by a prime square. For square-free numbers, an odd number of prime factors gives −1 and an even number gives 1.
M(n) is the summatory Möbius function: M(n) = μ(1) + μ(2) + ⋯ + μ(n). It is a running balance of positive and negative Möbius values.
By definition, μ(1) = 1. Since that is the only term in the first partial sum, M(1) = 1.
A positive integer is square-free when no square greater than 1 divides it. In its prime factorization, every prime exponent must be 0 or 1.
It uses a linear sieve to generate every exact μ(k) from 1 through n, then forms cumulative integer sums. Typed arrays keep the work memory-efficient, and no floating-point approximations are used.
M(n) requires all Möbius values through n. The ceiling keeps CPU and memory use predictable on mobile devices while still supporting substantial explorations.
Yes. The number and results remain in your browser. This calculator does not upload, save, or place the input in a URL.