如何在 1 到 2000 中計算出子集和能被 5 整除的子集有多少個?

DE_aemmprty發表於2024-03-22

速通版。

自信構造母函式:

\[\begin{aligned} f(x) &= (1 + x)(1 + x ^ 2)\cdots(1 + x ^ {2000})\\ &= c_0 + c_1 \times x + c_2 \times x ^ 2 + \cdots \end{aligned} \]

取五次單位根 \(\zeta^0, \zeta^1,\cdots,\zeta^4\)

嘗試計算 \(\sum_{i = 0}^4f(\zeta^i)\),有:

\[\begin{aligned} f(\zeta^1) & = [(1 + \zeta)(1 + \zeta^2)(1+\zeta^3)(1+\zeta^4)(1+\zeta^5)]^{400}\\ & = \{[(1+\zeta)(1+\zeta^4)][(1+\zeta^2)(1+\zeta^3)](1+\zeta^5)\}^{400} \end{aligned} \]

由於我們有 \(x^5 - 1 = (x - \zeta^0)(x-\zeta^1)\cdots(x-\zeta^4)\),則取 \(x = -1\)\(2 = (1 + \zeta^0)(1 + \zeta^1)\cdots(1+\zeta^4)\)

\(f(\zeta^1) = 2^{400}\)。易得 \(f(\zeta^2)=f(\zeta^3)=f(\zeta^4)=f(\zeta^1)=2^{400}\)。特殊的,\(f(\zeta^0) = f(1) = 2^{2000}\)

\(\sum_{i = 0}^4f(\zeta^i) = 2^{2000} + 4 \times 2 ^ {400}\)

又得知:

\[\begin{aligned} \sum_{i = 0}^4f(\zeta^i) &= 5 \times (c_0 + c_5 + \cdots) + (\zeta^0+\zeta^1+\cdots+\zeta^4) \times (c_1 + c_2 + c_3 + c_4 + c_6 + c_7 + \cdots)\\ &= 5\times(c_0+c_5+\cdots) \end{aligned} \]

\(c_0 + c_5 + \cdots = \frac{1}{5}(2^{2000} + 4 \times 2^{400}) = \frac{1}{5}(2^{2000}+2^{402})\)

相關文章