Möbius function
Multiplicative function
Definition
We say that function \(f\) is multiplicative if it satisfies the following two conditions:
-
\(f(1)==1\)
-
\(f(ab)==f(a)f(b)\) for a pair of relatively prime numbers \(a,b∈\mathbb{N^+}\).
And functions satisfy the following two conditions are called completely multiplicative functions:
-
\(f(1)==1\)
-
\(f(ab)==f(a)f(b)\) for \(a,b∈\mathbb{N}\).
Examples
-
\(\varepsilon(n)=[n==1]\) : is a completely multiplicative function;
-
\(\varphi(n)=\Sigma_{i=1}^n[gcd(i,n)==1]\) : is a multiplicative function;
-
\(1(n)=1\) :is a completely multiplicative function;
-
\(id(n)=n\) :is a completely multiplicative function;
Dirichlet convolution
Definition
If 3 functions \(F\) , \(f\) and \(g\) satisfies:
Then \(F\) is called the Dirichlet convolution of \(f\) and \(g\) ,denoted \(F=f*g\) .
Properties
Associative: \((f*g)*h=f*(g*h)\)
distributive over addition: \(f*(g+h)=f*g+f*h)\)
commutative: \(f*g=g*f\)
the identity element:
Proof :
The value of the function \((f∗ε)(n)\) is \(1\) if and only if \(n==d\) . Obviously \(f∗ε=f\).
Möbius function
Definition
For any integer \(n∈\mathbb{N}\) , the Mobius function of it denoted \(μ(n)\) , is defined as:
Properties
Property 1:
Proof:
-
Do the factorization of \(n\) : \(n=p_1*p_2*...p_t\) ;
-
Each \(d\) is a product of these factors , and the set of \(ds\) made up of the products of k factors \((k∈[1,t])\) .
-
And the answer is the sum of the \(ds\);
-
When use \(1\) factor , the value of \(μ(d)s\) are \((-1)^1\) , the number of \(ds\) is \(C_n^1\) , and the sum of \(μ(d)s\) is \(C_n^1*(-1)^1\);
-
When use \(2\) factors , the value of \(μ(d)s\) are \((-1)^2\) , the number of \(ds\) is \(C_n^2\) , and the sum of \(μ(d)s\) is \(C_n^2*(-1)^2\);
-
...
-
When use \(n\) factors , the value of \(μ(d)s\) are \((-1)^n\) , the number of \(ds\) is \(C_n^n\) , and the sum of \(μ(d)s\) is \(C_n^n*(-1)^n\);
-
Therefore :
- According to Binomial Theorem :
Property 2:
Proof:
-
When \(n=1\) , the value is \(1\);
-
When \(n=0\) , the value is \(0\);
-
When \(n>1\) , \(\underset{d|n}{\Sigma}μ(d)=0\) .
-
Obviously , \(μ∗I=ε\) .
Property 3:
The relationship with Euler's Totient Function :
Proof:
-
Let \(f(n)=\underset{d|n}{∑}ϕ(d)\)
-
Obviously , \(f\) is a Multiplicative function .
-
Do the factorization of \(n\) : \(n=p_1^{c_1}*p_2^{c_2}*...p_t^{c_t}\) ;
-
\(f\) is a Multiplicative function , which implies that :
- Therefore ,
- That is ,
- $\varphi=\varepsilon*\varphi $ , \(\varepsilon=\mu*I\) , so we get :
- \(\varphi*I=id\) , so we get :
Code
inline void Mobius(int n){
M[1]=1;
for(int i=2;i<=n;i++){
if(!marked[i]) prime[++SUM]=i,M[i]=-1;
for(int j=1;j<=SUM&&prime[j]*i<=n;j++){
marked[i*prime[j]]=1;
if(!(i%prime[j])) break;
else M[i*prime[j]]=-M[i];
}
}
}
Möbius inversion formula
Definition
The Mobius inversion formula expresses the values of \(f\) in terms of its summatory function of \(f\) .
For 2 arithmetic function \(f\) and \(f\) , if they satisfied :
We have :
Another form of Mobius inversion is :
For 2 arithmetic function \(f\) and \(f\) , if they satisfied :
We have :
Proof
For the first form:
-
\(F(n)=\underset{d|n}{\Sigma}f(d)\) , that is : \(F=f*I\)
-
Notice that \(I*\mu=\varepsilon\) , we get :
- That is , \(F(n)=\underset{d|n}{\Sigma}\mu(d)F(n/d)\) .
For the second form:
Let's prove it backwards from the results:
- Let \(k=d/n\) . Change all the \(n|d\) into \(k*n\) , we have:
- Substitute \(f\) into it , we get:
-
\(t\) is a multilpe of \(nk\) , and \(k,t\) goes from \(1\) to \(∞\) .
-
Thus , there are and only multiples of \(n\) that are be taken ;
-
Change the order of \(k\) and \(t\) :
-
There are still multiples and only multiples of \(n\) that are taken ,
-
because when \(n\) isn't a factor of \(t\) , the value of \(\underset{(nk)|t}{\Sigma}\mu(k)\) will be \(0\) and \(f(t)\underset{(nk)|t}{\Sigma}\mu(k)\) will be 0.
-
Therefore :
- And it can be written as :
- Using dirichlet convolution , we get :
- The value is 1 if and only if \(t/n==1\) , that is \(t==n\) . Obviously ,
- That is , \(\underset{n|d}{\Sigma}\mu(d/n)F(d)=f(n)\) .
浙公网安备 33010602011771号