标签:rac sig gcd lcm 莫比乌斯反演 == sigma 枚举 floor
$\Sigma_{i=1}^n\Sigma_{j=1}^mlcm(i,j)^{gcd(i,j)}$
$=\Sigma_{i=1}^n\Sigma_{j=1}^m (\frac{i*j}{gcd(i,j)})^{gcd(i,j)}$
枚举gcd(i,j)=d
$=\Sigma_{d=1}^n\Sigma_{i=1}^{\lfloor \frac{n}{d}\rfloor}\Sigma_{j=1}^{\lfloor \frac{m}{d}\rfloor}(d*i*j)^d*(gcd(i,j)==1)$
$=\Sigma_{d=1}^n\Sigma_{i=1}^{\lfloor \frac{n}{d}\rfloor}\Sigma_{j=1}^{\lfloor \frac{m}{d}\rfloor}\Sigma_{k|i且k|j}(d*i*j)^d$
$=\Sigma_{d=1}^nd^d\Sigma_{t=1}^{\lfloor\frac{n}{d}\rfloor}\mu(t)[\Sigma_{i=1}^{\lfloor\frac{n}{dt}\rfloor}(it)^d\Sigma_{j=1}^{\lfloor\frac{m}{d}\rfloor}(jt)^d]$
$=\Sigma_{d=1}^nd^d\Sigma_{t=1}^{\lfloor\frac{n}{d}\rfloor}\mu(t)*t^{2d}[\Sigma_{i=1}^{\lfloor\frac{n}{dt}\rfloor}i^d\Sigma_{j=1}^{\lfloor\frac{m}{dt}\rfloor}j^d]$
标签:rac sig gcd lcm 莫比乌斯反演 == sigma 枚举 floor
原文地址:http://www.cnblogs.com/SiriusRen/p/6702031.html