n = p 1 a 1 p 2 a 2 ⋯ p r a r \ n=p_{1}^{a_{1}} p_{2}^{a_{2}} \cdots p_{r}^{a_{r}} n=p1a1p2a2⋯prar
a ∣ b \ a \mid b a∣b: a \ a a整除 b \ b b
a ∤ b \ a \nmid b a∤b: a \ a a不整除 b \ b b
a k ∥ b \ a^{k} \parallel b ak∥b: a k ∣ b \ a^{k} \mid b ak∣b且 a k + 1 ∤ b \ a^{k+1} \nmid b ak+1∤b
( a , b ) \ (a,b) (a,b)最大公约数
[ a , b ] \ [a,b] [a,b]最小公倍数
h ( n ) = ∑ d ∣ n f ( n ) g ( n d ) = ∑ d 1 d 2 = n f ( d 1 ) g ( d 2 ) h(n)= \sum_{d \mid n} f(n) g(\frac{n}{d})=\sum_{d_{1} d_{2} =n} f(d_{1})g(d_{2}) h(n)=d∣n∑f(n)g(dn)=d1d2=n∑f(d1)g(d2)
也可写作:
h = f ∘ g h=f \circ g h=f∘g
这相当于一种运算。
( f ∘ g ) ∘ h = f ∘ ( g ∘ h ) (f \circ g) \circ h=f \circ(g \circ h) (f∘g)∘h=f∘(g∘h)
证明
        ( f ∘ g ) ∘ h = ∑ d 1 ∣ n { ∑ d 2 ∣ d 1 f ( d 2 ) g ( d 1 d 2 ) } g ( n d 1 )   = ∑ d 1 d 2 d 3 = n ( f ( d 1 ) g ( d 2 ) ) g ( d 3 )   = ∑ d 1 d 2 d 3 = n f ( d 1 ) ( g ( d 2 ) g ( d 3 ) )   = f ∘ ( g ∘ h )   \begin{array}{crl} & &\,\,\,\,\,\,\,(f \circ g) \circ h\\& &=\sum_{d_{1} \mid n}\{ \sum_{d_{2} \mid d_{1}}f(d_{2})g(\frac{d_{1}}{d_{2}})\} g(\frac{n}{d_{1}}) \\\,\\ & &=\sum_{d_{1} d_{2} d_{3}= n} (f(d_{1})g(d_{2}))g(d_{3}) \\\,\\ & &=\sum_{d_{1} d_{2} d_{3}= n} f(d_{1})(g(d_{2})g(d_{3}))\\\,\\ & &=f \circ(g \circ h)\\\,\\ \end{array} (f∘g)∘h=∑d1∣n{ ∑d2∣d1f(d2)g(d2d1)}g(d1n)=∑d1d2d3=n(f(d1)g(d2))g(d3)=∑d1d2d3=nf(d1)(g(d2)g(d3))=f∘(g∘h)
证毕
f ∘ g = g ∘ f f \circ g=g \circ f f∘g=g∘f
证明
f ∘ g = ∑ d 1 d 2 = n f ( d 1 ) g ( d 2 ) = ∑ d 1 d 2 = n g ( d 1 ) f ( d 2 ) = g ∘ f f \circ g=\sum_{d_{1} d_{2} =n} f(d_{1})g(d_{2})=\sum_{d_{1} d_{2} =n} g(d_{1})f(d_{2})=g \circ f f∘g=d1d2=n∑f(d1)g(d2)=d1d2=n∑g(d1)f(d2)=g∘f
证毕
对于 f \ f f存在 g \ g g使
f ∘ g = ϵ ( n ) f \circ g = \epsilon(n) f∘g=ϵ(n)
其中
ϵ ( n ) = [ n = 1 ] \epsilon(n)= [n=1] ϵ(n)=[n=1]
证明
g ( n ) = 1 f ( 1 ) ( [ n = 1 ] − ∑ i ∣ n , i ≠ n f ( i ) g ( n i ) ) g(n)=\frac{1}{f(1)} \left( \left[ n=1 \right] - \sum_{i \mid n,i \neq n}f(i) g(\frac{n}{i}) \right) g(n)=f(1)1⎝⎛[n=1]−i∣n,i̸=n∑f(i)g(in)⎠⎞
如此一来
∑ d ∣ n f ( d ) g ( n d ) = f ( 1 ) g ( n ) − ∑ d ∣ n , d ≠ 1 f ( d ) g ( n d ) = [ n = 1 ] \sum_{d \mid n}f(d)g(\frac{n}{d})=f(1)g(n)-\sum_{d \mid n,d \neq 1}f(d)g(\frac{n}{d})=\left[ n=1 \right] d∣n∑f(d)g(dn)=f(1)g(n)−d∣n,d̸=1∑f(d)g(dn)=[n=1]
证毕
f ∘ ( g + h ) = f ∘ g + f ∘ h f \circ (g + h)=f \circ g+f \circ h f∘(g+h)=f∘g+f∘h
证明
f ∘ ( g + h ) = ∑ d 1 d 2 = n f ( d 1 ) ( g ( d 2 ) + h ( d 2 ) ) = ∑ d 1 d 2 = n f ( d 1 ) g ( d 2 ) + ∑ d 1 d 2 = n f ( d 1 ) h ( d 2 ) = f ∘ g + f ∘ h f \circ (g + h)=\sum_{d_{1} d_{2} =n} f(d_{1})(g(d_{2})+h(d_{2}))=\sum_{d_{1} d_{2} =n} f(d_{1})g(d_{2})+\sum_{d_{1} d_{2} =n} f(d_{1})h(d_{2})=f \circ g+f \circ h f∘(g+h)=d1d2=n∑f(d1)(g(d2)+h(d2))=d1d2=n∑f(d1)g(d2)+d1d2=n∑f(d1)h(d2)=f∘g+f∘h
( s ⋅ f ) ∘ g = s ⋅ ( f ∘ g ) (s \cdot f) \circ g=s \cdot (f \circ g) (s⋅f)∘g=s⋅(f∘g)
证明
( s ⋅ f ) ∘ g = ∑ d 1 d 2 = n ( s ⋅ f ( d 1 ) ) g ( d 2 ) = s ∑ d 1 d 2 = n f ( d 1 ) g ( d 2 ) (s \cdot f) \circ g=\sum_{d_{1} d_{2} =n} (s\cdot f(d_{1}))g(d_{2})=s\sum_{d_{1} d_{2} =n}f(d_{1})g(d_{2}) (s⋅f)∘g=d1d2=n∑(s⋅f(d1))g(d2)=sd1d2=n∑f(d1)g(d2)
证毕
若 f ( n ) , g ( n ) \ f(n),g(n) f(n),g(n)为积性 h = f ∘ g \ h=f \circ g h=f∘g也是积性的
        h ( n m )   = ∑ d ∣ n m f ( d ) g ( n m d )   = ∑ a ∣ n , b ∣ m f ( a b ) g ( n m a b )   = ∑ a ∣ n , b ∣ m f ( a ) g ( n a ) f ( b ) g ( m b )   = { ∑ a ∣ n f ( a ) g ( n a ) } { ∑ b ∣ m f ( b ) g ( m b ) }   = h ( n ) h ( m ) \begin{array}{rcl} & &\,\,\,\,\,\,\,h(nm)\\\,\\ & &=\sum_{d \mid nm} f(d) g(\frac{nm}{d}) \\\,\\ & &=\sum_{a \mid n,b \mid m} f(ab)g(\frac{nm}{ab}) \\\,\\ & &=\sum_{a \mid n,b \mid m} f(a)g(\frac{n}{a}) f(b)g(\frac{m}{b}) \\\,\\ & &=\{ \sum_{a \mid n} f(a)g(\frac{n}{a}) \}\{ \sum_{b \mid m} f(b)g(\frac{m}{b}) \} \\\,\\ & &=h(n)h(m) \end{array} h(nm)=∑d∣nmf(d)g(dnm)=∑a∣n,b∣mf(ab)g(abnm)=∑a∣n,b∣mf(a)g(an)f(b)g(bm)={ ∑a∣nf(a)g(an)}{ ∑b∣mf(b)g(bm)}=h(n)h(m)
证毕
证明
设 n m > 1 \ nm>1 nm>1时有 n ′ m ′ < n m , g ( n ′ m ′ ) = g ( n ′ ) g ( m ′ ) \ n'm' < nm,g(n'm')=g(n')g(m') n′m′<nm,g(n′m′)=g(n′)g(m′)成立
f ( n ) \ f(n) f(n)的逆元 g ( n ) = 1 f ( 1 ) ( [ n = 1 ] − ∑ i ∣ n , i ≠ n f ( i ) g ( n i ) ) \ g(n)=\frac{1}{f(1)} \left( \left[ n=1 \right] - \sum_{i \mid n,i \neq n}f(i) g(\frac{n}{i}) \right) g(n)=f(1)1([n=1]−∑i∣n,i̸=nf(i)g(in))
        g ( n m )   = − ∑ d ∣ n m , d ≠ 1 f ( d ) g ( n m d )   = − ∑ a ∣ n , b ∣ m , a b ≠ 1 f ( a b ) g ( n m a b )   = f ( 1 ) f ( 1 ) g ( n ) g ( m ) − ∑ a ∣ n , b ∣ m , a b ≠ 1 f ( a ) f ( b ) g ( n a ) g ( m b )   = g ( n ) g ( m ) − { ∑ a ∣ n , a ≠ 1 f ( a ) g ( n a ) } { ∑ b ∣ m , b ≠ 1 f ( b ) g ( m b ) }   = g ( n ) g ( m ) − ϵ ( n ) ϵ ( m )   = g ( n ) g ( m ) \begin{array}{rcl} & &\,\,\,\,\,\,\,g(nm) \\\,\\ & &=- \sum_{d \mid nm,d \neq 1}f(d)g(\frac{nm}{d}) \\\,\\ & &=- \sum_{a \mid n,b \mid m,ab \neq 1} f(ab) g(\frac{nm}{ab}) \\\,\\ & &=f(1)f(1)g(n)g(m)- \sum_{a \mid n,b \mid m,ab \neq 1} f(a) f(b) g(\frac{n}{a}) g(\frac{m}{b}) \\\,\\ & &=g(n)g(m)- \{ \sum_{a \mid n,a \neq 1} f(a) g(\frac{n}{a}) \} \{ \sum_{b \mid m,b \neq 1} f(b) g(\frac{m}{b}) \}\\\,\\ & &=g(n)g(m)-\epsilon(n) \epsilon(m) \\\,\\ & &=g(n)g(m) \end{array} g(nm)=−∑d∣nm,d̸=1f(d)g(dnm)=−∑a∣n,b∣m,ab̸=1f(ab)g(abnm)=f(1)f(1)g(n)g(m)−∑a∣n,b∣m,ab̸=1f(a)f(b)g(an)g(bm)=g(n)g(m)−{ ∑a∣n,a̸=1f(a)g(an)}{ ∑b∣m,b̸=1f(b)g(bm)}=g(n)g(m)−ϵ(n)ϵ(m)=g(n)g(m)
证毕
我们总可以证明求一个狄利克雷卷积的复杂度是 O ( n ln n ) \ O(n \ln n) O(nlnn)的。