Möbius Function Calculator
Möbius Function Calculator computes \\( \mu(n) \\), the Möbius function value for a positive integer \\( n \\), and plots its values over a range of numbers.
Möbius Function
The Möbius function \\( \mu(n) \\) is defined for a positive integer \\( n \\) as:
Special case: \\( \mu(1) = 1 \\).
Properties:
- For a prime \\( p \\), \\( \mu(p) = -1 \\).
- For a prime power \\( p^k \\), \\( \mu(p^k) = 0 \\) if \\( k \geq 2 \\).
- For \\( n \\) with prime factorization \\( n = p_1^{e_1} p_2^{e_2} \cdots p_k^{e_k} \\), \\( \mu(n) = 0 \\) if any \\( e_i \geq 2 \\), otherwise \\( \mu(n) = (-1)^k \\).
- The Möbius function is multiplicative: if \\( \gcd(m, n) = 1 \\), then \\( \mu(mn) = \mu(m) \mu(n) \\).
Examples
Example 1
Input: \\( n = 6 \\)
Prime factorization: \\( 6 = 2 \cdot 3 \\).
Two distinct prime factors (even number), square-free.
\\( \mu(6) = (-1)^2 = 1 \\).
Example 2
Input: \\( n = 8 \\)
Prime factorization: \\( 8 = 2^3 \\).
Has a squared prime factor (\\( 2^3 \\)).
\\( \mu(8) = 0 \\).
Example 3
Input: \\( n = 30 \\)
Prime factorization: \\( 30 = 2 \cdot 3 \cdot 5 \\).
Three distinct prime factors (odd number), square-free.
\\( \mu(30) = (-1)^3 = -1 \\).