Arithmetical functions (Euler function and Mobius inversion)

After a few dishes on the dog courage, learning the Mobius inversion - find themselves even dog food not. . .

Some define the basic function of number theory

  • \(id(n)=n\)

  • \(1(n)=1\)

  • \(\epsilon(n)=\left\{\begin{array}{rcl}1&n=1\\0&n\neq 1\end{array}\right.\)

These arithmetical functions are completely multiplicative function.

(Multiplicative function satisfies \ (F (A \ Times B) = F (A) \ Times F (B) \) , \ (GCD (A, B) =. 1 \) , and completely multiplicative function satisfies \ (F (a \ B Times) = F (a) \ F Times (B) \) , without satisfying (gcd = 1 \) \ conditions)

Dirichlet convolution

\((f*g)_{(n)}=\sum_{d|n}f(d)\times g(\frac{n}{d})\)

This thing is commutative, associative, distributive law.


  • Commutative proof:

\((f*g)_{{n}}=\sum_{d|n}f(d)\times g(\frac{n}{d})=\sum_{d|n}f(\frac{n}{d})\times g(d)=(g*f)_{(n)}\)


  • Associativity of proof:

\(((f*g)*h)_{(n)}=\sum_{d|n}h(\frac{n}{d})\sum_{k|d}f(k)\times g(\frac{d}{k})\)

\(\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ =\sum_{d|n}\sum_{k|d}f(k)\times g(\frac{d}{k})\times h(\frac{n}{d})\)

\(\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ =\sum_{k|n}\sum_{q|\frac{n}{k}}f(k)\times g(q)\times h(\frac{n}{kq})\)

\(\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ =\sum_{k|n}f(k)\sum_{q|\frac{n}{k}}g(q)\times h(\frac{n}{kq})\)

\(\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ =(f*(g*h))_{(n)}\)


  • Distributive law of proof:

\((f*(g+h))_{(n)}=\sum_{d|n}f(d)\times(g(\frac{n}{d})+h(\frac{n}{d}))\)

\(\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ =\sum_{d|n}f(d)\times g(\frac{n}{d})+f(d)\times h(\frac{n}{d})\)

\(\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ =(f*g)_{(n)}+(f*g)_{(n)}\)


  • \ (f * \ Epsilon = f \) , is very simple, not a card.

\ (\ varphi \) defined functions

\ (\ varphi (n) \ ) is defined as: \ (. 1-n-\) in all \ (n-\) number of prime numbers.

\ (\ varphi \) of the product and proof of

\ (\ varphi \) is a multiplicative function

We \ (1-a \ times b \) these numbers written as a rectangle:

\(\left(\begin{array}{cc}1&2&...&a\\a+1&a+2&...&2a\\.&.&...&.\\.&.&...&.\\.&.&...&.\\(b-1)a+1&(b-1)a+2...&...&ab\end{array}\right)\)

For each row:

  • Since \ ((a, b) = 1 \) so that each row has \ (\ varphi (a) \ ) number and \ (A \) prime.

For each column:

  • Since this \ (B \) number \ (\% b \) the remainder different from each other, so that each column will have \ (\ varphi (a) \ ) number and \ (B \) prime.

In summary: \ (\ varphi (A \ B Times) = \ varphi (A) \ Times \ varphi (B) \) , i.e., \ (\ varphi \) is a multiplicative function.

\ (\ varphi \) Some properties of functions

  • If \ (\ varphi (n-) \) , \ (n-\) is a prime number, set \ (n-= P ^ C \) , then the \ (\ varphi (n) = p ^ cp ^ {c-1} \ ) . (Not a card)

  • \(\varphi(n)=n\times\prod_{i=1}^k1-\frac{1}{p_i}\)

prove:

\(n=\prod_{i=1}^{k}p_i^{c_i}\)

\(\varphi(n)=\prod_{i=1}^k\varphi(p_i^{c_i})\)

\(\varphi(n)=\prod_{i=1}^kp_i^{c_i}\times(1-\frac{1}{p_i})\)

\(\varphi(n)=n\times\prod_{i=1}^k1-\frac{1}{p_i}\)

QED


  • \(\varphi*1=id\)

prove:

Set \ (F (n-) = \ sum_ {D |} n-\ varphi (D) \) .

\(\because (n,m)=1\)

\(f(n)\times f(m)=\sum_{i|n}\varphi(i)\times\sum_{j|m}\varphi(j)\)

\(\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ =\sum_{i|n}\sum_{j|m}\varphi(i)\times \varphi(j)\)

\(\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ =\sum_{ij|nm}\varphi(ij)\)

\(\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ =f(n\times m)\)

\ (\ therefore f (n) \) is a multiplicative function.

\(f(p^c)=\sum_{d|p^c}\varphi(d)=\varphi(1)+\varphi(p)+\varphi(p^2)+...+\varphi(p^{c-1})=p^c\)

\(n=\prod_{i=1}^{k}p_i^{c_i}\)

\(\therefore f(n)=\prod_{i=1}^kp_i^{c_i}=n\)

That \ (F = \ varphi ID = *. 1 \) .

QED

\ (\ varphi \) functions method for finding

Now that we have come before the \ (\ varphi \) the general term formula, so now think about \ (\ varphi \) should be how to find it.

I heard this guy called the Euler function, that - of course with a linear screen to find it.

While we can wire sieve to obtain prime numbers, the \ (\ varphi \) also gave updated.

Code:

void sieve(){
    varphi[1]=1;
    for(int i=2;i<=n;i++){
        if (!vis[i]) p[++p[0]]=i,varphi[i]=i-1;
        for (int j=1;j<=p[0]&&i*p[j]<=n;j++){
            vis[i*p[j]]=1;
            if (i%p[j]==0){
                varphi[i*p[j]]=varphi[i]*p[j];
                break;
            }
            varphi[i*p[j]]=varphi[i]*(p[j]-1);
        }
    }
}

\ (\ mu \) defined functions

\(n=\prod_{i=1}^{k}p_i^{c_i}\)

\(\mu(n)=\left\{\begin{array}{rcl}1&n=1\\(-1)^k&\forall c_i,c_i\le1\\0&\exists c_i>1\end{array}\right.\)

\ (\ mu \) Some properties of functions

  • \ (\ mu \) have multiplicative

prove:

Young \ (\ mu (a) = 0 \) some \ (\ Mu (B) = 0 \) , Provisions \ (\ mu (a \ times b) = \ mu (a) \ times \ mu (b) \ ) .

\ (\ because (a, b ) = 1 \ therefore a \) is the quality factor, the \ (B \) prime factors different from each other.

\(\therefore \mu(a\times b)=\mu(a)\times\mu(b),(a,b)=1\)

QED


  • \ (\ M * 1 = \ epsilon \)

prove:

Can be converted to the original proposition: \ (\ sum_ {D |} n-\ MU (D) = [D =. 1] \)

Set \ (n-\) have \ (K \) a prime factor.

\(\mu*1=\sum_{d|n}\mu(d)=\sum_{i=0}^k(-1)^i\times C_k^i\)

Expand the \ (\ SUM \) , give:

\ (= U *. 1-C_k C_k ^ ^ 0 ^ C_k. 1 + 2 -... (+/-) C_m ^ m = (1-1 of) ^ m \) , intermediate with the binomial theorem.

\(\therefore \mu*1=\epsilon\)

QED


  • \(id*\mu=\varphi\)

prove:

While the volume on both sides \ (1 \) .

\(\ \ \ \ \ \ id*\mu=\varphi\)

\(id*\mu*1=\varphi*1\)

\ (\ \ \ \ \ \ \ \ M * 1 = \ epsilon \)

QED

Mobius inversion

\(g(n)=\sum_{d|n}f(d)\)\(f(n)=\sum_{d|n}\mu(d)\times g(\frac{n}{d})\)

prove:

\(f(n)=\sum_{d|n}\mu(d)\times g(\frac{n}{d})\)

\(\ \ \ \ \ \ \ \ \ =\sum_{d|n}\mu(d)\sum_{i|\frac{n}{d}}f(i)\)

\(\ \ \ \ \ \ \ \ \ =\sum_{i|n}f(i)\sum_{d|\frac{n}{i}}\mu(d)\)

\(\ \ \ \ \ \ \ \ \ =\sum_{i|n}f(i)\times (\mu*1)_{[\frac{d}{i}]}\)

\(\ \ \ \ \ \ \ \ \ =\sum_{i|n}f(i)\times\epsilon(\frac{n}{i})\)

\(\ \ \ \ \ \ \ \ \ =f(n)\)

QED

In fact, there are other forms:

\(g(n)=∑_{d|n}f(n)\)\(f(n)=∑_{d|n}μ(d)g(\frac{n}{d})\)

Prove similar, also requested the reader to deduce.

Guess you like

Origin www.cnblogs.com/WR-Eternity/p/10939746.html