# 「总结」狄利克雷卷积，莫比乌斯反演和杜教筛

### 0. 一些奇奇怪怪的数论函数

\begin{aligned}1. \; & \textbf{1}(x) = 1 \\2. \; & \textbf{id}(x) = x, \textbf{id}^k(x) = x ^ k \\3. \; & \textbf{d}(x) = \sum_{d \mid x} 1 \\4. \; & \sigma(x) = \sum_{d\mid x} d\\ 5. \; & \epsilon(x) = [x = 1]\end{aligned}

### 1. 狄利克雷卷积

$\textbf{h} = \textbf{f} * \textbf{g}$，那么：

$\textbf{h}(x) = \sum_{d\mid x} \textbf{f}(d)\textbf{g}(\frac nd)$

\begin{aligned}1.\;& \textbf{d} = \textbf 1 * \textbf 1\\ 2.\; & \sigma = \textbf 1 * \textbf{id} \\ 3. \; & \textbf{id} = \textbf 1 * \varphi \\ 4. \; & \sigma = \textbf 1 * \textbf 1 * \varphi = \textbf d * \varphi \end{aligned}

### 2. 莫比乌斯反演

$\mu * \textbf 1 = \epsilon$，那么设$\textbf f = \textbf 1 * \textbf g$，则$\textbf g = \mu * \textbf f$

\begin{aligned} 1. \; & \varphi = \textbf{id} * \mu \\ 2. \; & \textbf 1 = \mu * \textbf d \\ 3. \; & \textbf{id} = \sigma * \mu \end{aligned}

$\mu(n) = \begin{cases} 1 & k = 0 \\ -1 & k = 1 \\ 0 & k > 1 \end{cases}$

$\because \textbf f = \sigma,\therefore \textbf g = \mu * \sigma$

Wow!

\begin{aligned} &\sum_{i=1}^n\sum_{j=1}^m \sigma(\gcd(i,j)) \\ =& \sum_{i=1}^n\sum_{j=1}^m\sum_{d|i, d|j} d \\ =& \sum_{d=1}^nd\sum_{d|i}^n\sum_{d|j}^m 1 \\ =& \sum_{d=1}^n d\left\lfloor\frac nd\right\rfloor\left\lfloor\frac md\right\rfloor \end{aligned}

### 3. 杜教筛

\begin{aligned} \because \sum_{i=1}^n (\textbf f * \textbf g)(i) &= \sum_{i=1}^n\sum_{d\mid i} \textbf f\left(\left\lfloor\frac id\right\rfloor\right) \textbf g(d) \\ &= \sum_{d=1}^n \textbf g(d) \sum_{i=1}^{n/d} \textbf f(i) \\ &= \sum_{i=1}^n \textbf g(i) \textbf S\left(\left\lfloor\frac ni\right\rfloor\right) \end{aligned}

$\sum_{i=1}^n\sum_{j=1}^nij\gcd(i,j), n \leq 10^{10}$

\begin{aligned} &\sum_{i=1}^n\sum_{j=1}^n ij\gcd(i,j) \\ =& \sum_{i=1}^n\sum_{j=1}^nij\sum_{d|i, d|j} \varphi(d) \\ =& \sum_{d=1}^n\varphi(d)\sum_{d|i}i\sum_{d|j}j \\ =& \sum_{d=1}^n d^2 \varphi(d) S\left(\left\lfloor\frac nd\right\rfloor\right)^2 \end{aligned}

$\textbf f$为完全积性函数，$\textbf g, \textbf h$是数论函数，那么$(\textbf f \cdot \textbf g) * (\textbf f \cdot \textbf h) = \textbf f \cdot(\textbf g * \textbf h)$

posted @ 2019-03-24 10:48  xgzc  阅读(352)  评论(6编辑  收藏  举报