DLSTXDY
积性函数
对于任意a,b,gcd(a,b) == 1,都有f(ab) = f(a)f(b).
也就是f(n)=f(p1^e1)...f(pk^ek)
- 常见的积性函数有 d(x), σ(x), id(x), e(x), I(x), µ(x) d(x) = ∑a|x 1, σ(x) = ∑a|x a, id(x) = x, I(x) = 1 e(x) = 1 ⇐⇒ x = 1
- 对于积性函数,一定有f(1)=1
狄利克雷卷积
对于两个数论函数f和g,我们称h为f×g,也就是h(x) = ∑a|x f(a)g( x/a )为这两个函数的(狄利克雷)卷积
- 容易证明卷积符合交换律,结合律
- 卷积不要求两个函数都是积性函数.
- 积性函数卷一个积性函数还是一个积性函数
莫比乌斯函数
内容:μ(n) = 0(n有平方因子)或(-1)^k(n=p1×p2×...×pk)
- μ是积性函数
- μ×I=e: 由于I(x)=1,e(x)=(x==1),通过每一个质因子验证即可.
莫比乌斯反演
如果 F(n) = ∑d|n f(d), 那么 f(n) ∑d|n µ(d) ∗ F( n / d ) F = f ∗ I ⇒ F ∗ µ = (f ∗ I) ∗ µ = f ∗ (I ∗ µ) = f ∗ e = f
筛法
- 筛素数
- 求积性函数的值
例题
令f(i)表示将i分解为a×b×c的方案数,求f(1)...f(n)(a×b×c与b×c×a视为不同)