[学习笔记]积性函数复习
发现根本不会。。复习一下
1.卷积
狄利克雷卷积
\[(f * g)(n) = \sum_{d|n}f(d)g(\frac {n} {d})
\]
2.定义数论函数
\[\epsilon(n) = [n == 1]
\]
\[id(n) = n
\]
\[1(n) = 1
\]
\[\varphi(n) = \sum_{d|n}1
\]
性质
\[\sum_{i = 1}^{n} [(n, i) = 1]* i = \frac{[n = 1] + n * \varphi(n)}{2}
\]
积性函数的点积和狄利克雷卷积也是积性函数
3.常见的数论函数卷积
\[\varphi * 1 = id
\]
\[\mu * 1 = \epsilon
\]
\[\mu * id = \varphi
\]
\[1 * 1 = \sigma
\]
\[id * 1 = \sigma_0
\]
\[\epsilon * f = f
\]
注:
\[d(n, m) = \sum_{i=1}^{n}\sum_{j=1}^{m}[gcd(i, j) = 1]
\]
4.mobius反演
形式一
\[g = f * 1
\]
\[f = g * \mu
\]
形式二
\[g(n) = \sum_{n|d}f(d)
\]
\[f(n) = \sum_{n|d}\mu(\frac{d}{n})g(d)
\]
5.例子
\[\sum_{i=1}^{n}\sum_{j=1}^{m}gcd(i, j) ^ k
\]
枚举\(d\)
\[\sum_{d=1}^{n} d^k \sum_{i=1}^{\frac{n}{d}} \sum_{j=1}^{\frac{m}{d}} [gcd(i, j)=1]
\]
有
\[\sum_{d|n} \mu(d) = [n = 1]
\]
代入可以交换求和顺序 并且计算倍数可以得到
\[\sum_{d=1}^{n} d^k \sum_{e=1}^{n} \mu(e) \frac{n}{de} \frac {m}{de}
\]
设\(D = ed\)
\[\sum_{D=1}^{n} \sum_{d|D}d^k \mu(\frac{D}{d}) \frac{n}{de} \frac {m}{de}
\]
记\(f(D) = \sum_{d|D}d^k \mu(\frac{D}{d})\) 为积性函数
\[f(D) = \prod_{p_i}f(p_i^{x_i})
\]
\[= \prod_{p_i} p_i^{kx_i}\mu(1) + pi^{k(x_i-1)} \mu(pi)
\]
\[= \prod_{p_i} p_i^{k(x_i - 1)}(pi^k-1)
\]
线性筛就好了