约数个数与约数和定理
约数个数定理:
约数个数=\(\displaystyle \prod^{k}_{i= 1} (a_i + 1)\)
证明:
由唯一分解定理\(n = p_1 ^{a_1} p_2 ^{a_2}p_3 ^{a_3}...p_k ^{a_k}\)可得:
\(n\)的约数一定是 \(p_1^{x} ... p_k^{z}\) \(x \in [0, a_1] ... z \in [0, a_k]\)
每一个可以取 \(a_i +1\)种可能.
根据乘法原理约数个数\(= (a_1 + 1) \ast (a_2 + 1) \ast ...\ast (a_k + 1)\).
即:
\[\displaystyle \prod^{k}_{i= 1} (a_i + 1)
\]
约数和定理
\(sum = \displaystyle \prod_{i =1}^n \sum_{j = 0}^{a_i}p_i^j\)
证明:
现将n质因数分解.
\(n = p_1^{a_1}p_2^{a_2}...p_k^{a_k}\)
则:其任意一因子p可表示为:
\(p=p_1^{b1}\times p_2^{b2}\times ... (0 =<b1<=a1,0=<b2<=a2,...)\)
根据乘法原理他们的和为:
\((p_1^0 +p_1^1 +…p_1^{a_1})(p_2^0 +p_2^1 +…p_2^{a_2})…(p_k^0+p_k^1 +…p_k ^{a_k})\)
所以sum = \(\displaystyle \prod_{i =1}^n \sum_{j = 0}^{a_i}p_i^j\)