Squarefree Factors
对于 54 54 54,考虑他的因数分解,如果因子必须是squarefree number,则只有两种方法:
54 = 3 ∗ 3 ∗ 6 = 2 ∗ 3 ∗ 3 ∗ 3 \begin{aligned} 54 &= 3*3*6\\ &= 2*3*3*3 \end{aligned} 54=3∗3∗6=2∗3∗3∗3
我们记作 F s t ( 54 ) = 2 Fst(54)=2 Fst(54)=2
我们定义 S ( n ) = ∑ k = 2 n F s t ( k ) S(n)=\sum_{k=2}^{n}{Fst(k)} S(n)=k=2∑nFst(k)
求 S ( 1 0 10 ) 求S(10^{10}) 求S(1010)
思路
我们不考虑计算某一个数的 F s t Fst Fst的值,而是直接计算 S S S的值
我们定义 F ( N , s t a r t ) F(N, start) F(N,start)为一个非递降一个序列,其中都是squarefree number,且第一项 ≥ \ge ≥start且,序列的乘积 ≤ \le ≤N的序列的总数.
形式化的表达如下:
考虑如下序列的个数为 F ( N , s t a r t ) F(N, start) F(N,start):
a 1 , a 2 , a 3 . . . a n a_1, a_2, a_3...a_n a1,a2,a3...an, 其中 a 1 ≥ a 2 ≥ a 3 . . . ≥ a n a_1 \ge a_2 \ge a_3... \ge a_n a1≥a2≥a3...≥an 且 a 1 ⋅ a 2 ⋅ a 3 ⋅ ⋅ ⋅ ⋅ a n ≤ N a_1 \cdot a_2 \cdot a_3 \cdot\cdot\cdot\cdot a_n \le N a1⋅a2⋅a3⋅⋅⋅⋅an≤N
那么最终答案表达式为 F ( 1 0 10 , 2 ) F(10^{10}, 2) F(1010,2)
如何计算
考虑序列的长度为1和大于的情况
- 如果序列长度为 1 1 1, 那么 F ( N , s t a r t ) = ∑ i = s t a r t N F(N, start) = \sum_{i=start}^{N} F(N,start)=∑i=startN, i i i是squarefree number
- 如果序列长度大于 1 1 1,显然 a 1 ≤ N a_1 \le \sqrt{N} a1≤N. 考虑枚举 a 1 a_1 a1的值,注意 a 1 a_1 a1的是一个squarefree number
F ( N , s t a r t ) = ∑ i = s t a r t N F ( N i , i ) F(N, start)=\sum_{i=start}^{\sqrt{N}}F(\frac{N}{i}, i) F(N,start)=i=start∑NF(iN,i)
对于是一个squarefree number的 x x x,我们有 μ 2 ( x ) = 1 \mu^2(x)=1 μ2(x)=1,因此可以把式子写为
F ( N , s t a r t ) = ∑ i = s t a r t N ⋅ μ 2 ( i ) + ∑ i = s t a r t N F ( N i , , i ) ⋅ μ 2 ( i ) F(N, start)=\sum_{i=start}^{N}\cdot\mu^2(i) + \sum_{i=start}^{\sqrt{N}}F(\frac{N}{i,}, i)\cdot\mu^2(i) F(N,start)=i=start∑N⋅μ2(i)+i=start∑NF(i,N,i)⋅μ2(i)