mmm 颗珠子,nnn 种颜色: L=1m⋅∑i=1mngcd(i,m)L=\dfrac{1}{m}\cdot \sum ^{m}_{i=1}n^{\gcd \left( i,m\right) }L=m1⋅∑i=1mngcd(i,m)
当 n=mn=mn=m :L=1n∑p∣n(φ(p)⋅nnp)=∑p∣n(φ(p)⋅nnp−1)L=\dfrac{1}{n}\sum _{p|n}(\varphi\left(p\right)\cdot n^{\dfrac{n}{p}})=\sum _{p|n}(\varphi\left(p\right)\cdot n^{\dfrac{n}{p}-1})L=n1∑p∣n(φ(p)⋅npn)=∑p∣n(φ(p)⋅npn−1)
最后更新于4年前
这有帮助吗?