题意
给定(n),求(sumlimits_{i=1}^n sumlimits_{j=1}^n sumlimits_{k=1}^n [(i,j),(i,k)])
做法
令(f[n]=sumlimits_{i=1}^n sumlimits_{j=1}^n [(n,i),(n,j)])
将其展开一下,是这样的
[sumlimits_{d_1|n}sumlimits_{d_2|n}[d_1,d_2](sumlimits_{k|frac{n}{d_1}}mu(k)frac{n}{d_1k})(sumlimits_{k|frac{n}{d_2}}mu(k)frac{n}{d_2k})
]
这样看的话显然f是个积性函数了
(f[p^k]=(2∗k+1)∗(p^{2k}−p^{2k−1})+p^{k−1})