https://www.51nod.com/Challenge/Problem.html#!#problemId=1363
求\(\sum\limits_{i=1}^{n}lcm(i,n)\)
---
先换成gcd
\(\sum\limits_{i=1}^{n}\frac{i*n}{gcd(i,n)}\)
显而易见,枚举g
$ n * \sum\limits_{g|n} \frac{1}{g} \sum\limits_{i=1}^{n} i*[gcd(i,n)==g] $
提g,没有下整符号
$ n * \sum\limits_{g|n} \frac{1}{g} \sum\limits_{i=1}^{\frac{n}{g}} i*[gcd(i,\frac{n}{g})==1] $