definition
If a number theory function \ (f (n) \) satisfies
\[f(pq)=f(p)f(q),p\perp q\]
Called \ (f (n) \) is a multiplicative function.
In particular, if not required \ (p \ perp q \) and still satisfy the above equation, then, called \ (f (n) \) is a multiplicative function fully.
Common multiplicative function
\ [E (n) = [n = 1] \]
\[1(n)=1\]
\[\mu(n)=\begin{cases}(-1)^k&n=p_1p_2p_3\dots p_k\\0&n=p^2q\end{cases}\]
\[\varphi(n)=\sum_{i=1}^n[i\perp n]\]
\[d(n)=\sum_{i|n}1\]
\[id(n)=n\]
\[\sigma(n)=\sum_{d|n}d\]
As to why they are multiplicative function ,,,,
I do not so much.
Dirichlet convolution
definition
\[f*g(n)=\sum_{d|n}f(d)g(\frac nd)\]
It can then be computed into an enumerator about multiple enumeration (will be mentioned below) to the harmonic series \ (O (nlogn) \) complexity determined \ (f * g \) before \ (n- ) \ item.
Commutative law
\[f*g(n)=\sum_{d|n}f(d)g(\frac nd)=\sum_{d|n}g(d)f(\frac nd)=g*f(n)\]
Associativity
\[f*g*h(n)=\sum_{d|n}f(d)\sum_{t|\frac nd}g(t)h(\frac n{dt})=\sum_{d_1d_2d_3=n}f(d_1)g(d_2)h(d_3)=f*(g*h)(n)\]
Common multiplicative function of convolution
\[\forall f(n),e*f(n)=f(n)\]
\[1*1(n)=\sum_{d|n}1=d(n)\]
\[id*1(n)=\sum_{d|n}d=\sigma(n)\]
\ [\ Mu * 1 (n) = \ sum_ {d | n} \ mu (d) = [n = 1] = f (n) \]
This need is particularly explain.
Suppose \ (n-P_1 ^ = {P_2 k_1}} ^ {K_2 \ DOTS P_m K_m} ^ {\) , then the above equation can be rewritten as:
\[\mu*1(n)=\sum_{c_1=0}^{k_1}\sum_{c_2=0}^{k_2}\dots\sum_{c_m=0}^{k_m}\mu(p_1^{c_1}p_2^{c_2}\dots p_m^{c_m})\]
Observation \ (\ mu (n) \ ) is defined, it can be found in \ (n-\) number of prime factors, but also to when a prime factors occur more than once, \ (\ MU (n-) = 0 \ ) . In this case, as long as the \ (c_1 and \) to \ (C_N \) there is any greater than \ (1 \) , followed by the \ (\ MU \) value will be \ (0 \) .
In this case, we can greatly reduce the enumeration range:
\[\mu*1(n)=\sum_{c_1=0}^1\sum_{c_2=0}^1\dots\sum_{c_m=0}^1\mu(p_1^{c_1}p_2^{c_2}\dots p_m^{c_m})\]
\[=\sum_{c_1=0}^1\sum_{c_2=0}^1\dots\sum_{c_m=0}^1(-1)^{\sum_{i=1}^mc_i}\]
\[=\sum_{i=0}^m(-1)^i\dbinom mi\]
\[=[m=0]=[n=1]=e(n)\]
The last formula that is why the \ ([m = 0] \) , Proof varied, not repeat them here.
Then continued:
\[\varphi*1(n)=\sum_{d|n}\varphi(d)=n=id(n)\]
This is why?
Direct evidence is too much trouble, we use \ (\ mu * 1 = e \) permit a turn of formula:
\[\varphi(n)=id*\mu(n)\]
Direct violence demolition formula can be. To use some of the techniques mentioned below, you can go back and look.
\[\varphi(n)=\sum_{i=1}^n[i\perp n]\]
\[=\sum_{i=1}^n[(i,n)==1]\]
\[=\sum_{i=1}^n\sum_{d|(i,n)}\mu(d)\]
\[=\sum_{d|n}\mu(d)\frac nd\]
\[=id*\mu(n)\]
In this way, we completed the unification of the above product functions:
\[\mu\xrightarrow{*1}e\xrightarrow{*1}1\xrightarrow{*1}d\]
\[\varphi\xrightarrow{*1}id\xrightarrow{*1}\sigma\]
In turn, can be:
\[\mu\xleftarrow{*\mu}e\xleftarrow{*\mu}1\xleftarrow{*\mu}d\]
\[\varphi\xleftarrow{*\mu}id\xleftarrow{*\mu}\sigma\]
Mobius inversion
Stirling similar binomial inversion and inversion, there is one such inversion formula:
\[f(n)=\sum_{d|n}g(d)\iff g(n)=\sum_{d|n}\mu(\frac nd)f(d)\]
In fact, no hair, because its essence is this:
\[f=g*1\iff g=\mu*f\]
But look at it this way, it seems that nonsense.
General Tips
Unrelated items in advance
Essentially distributive law.
\ [\ Sum_ {i = 1} ^ n \ sum_ {j = 1} ^ ma_ib_j = \ sum_ {i = 1} ^ na_i \ sum_ {j = 1} ^ mb_j \]
Exchange enumeration order
\ [\ Sum_ {i = 1} ^ na_i \ sum_ {j = 1} ^ mb_j = \ sum_ {j = 1} ^ mb_j \ sum_ {i = 1} ^ na_i \]
This looks very \ (Naive \) .
More important is about to enumerate the number becomes a multiple enumeration:
\[\sum_{i=1}^na_i\sum_{d|i}b_d=\sum_{d=1}^nb_d\sum_{i=1}^{\lfloor\frac nd\rfloor}a_{id}\]
Inversion
Is the Dirichlet convolution relationship utilize it are the common functions of the product, in particular \ (\ *. 1 MU = E \) .
Block number theory
I'm actually in this \ (naive \) when their own \ (yy \) out.
For example, seeking \ (\ sum_ {I} = 0 n-^ \ lfloor \ FRAC Ni \ rfloor, n-\ leq10. 9 ^ \) .
Will not make a list of words, then will the。
When \ (n = 100 \) , you can find \ (\ lfloor \ frac n { 100} \ rfloor, \ lfloor \ frac n {99} \ rfloor, \ dots, \ lfloor \ frac n {51} \ rfloor \ ) are \ (. 1 \) , \ (\ lfloor \ {n-50} FRAC \ rfloor, \ lfloor \ {n-49} FRAC \ rfloor, \ DOTS, \ lfloor \ {n-34 is FRAC} \ rfloor \) are \ (2 \) , so we get a reliable conclusions:
\ (\ lfloor \ frac n { \ lfloor \ frac ni \ rfloor + 1} \ rfloor, \ lfloor \ frac n {\ lfloor \ frac ni \ rfloor + 2} \ rfloor, \ dots, \ lfloor \ frac n {\ lfloor \ frac n {i + 1 } \ rfloor} \ rfloor \) the result is \ (I +. 1 \) .
In this way we get a quick root algorithm:
For greater than \ (\ sqrt n \) number, a different \ (\ lfloor \ frac ni \ rfloor \) only \ (\ sqrt n \) number;
Less than \ (\ sqrt n \) number only \ (\ sqrt n \) a, can be considered direct violence.
……