Comet OJ - Contest #8 E.神奇函数

旧题解:https://blog.csdn.net/gmh77/article/details/99066792#commentBox

之前写的有些奇怪,不能体现这道题的sb所以再推一遍

\(\because n=\sum_{d \mid n}{\varphi(d)}\)

\(\therefore \sum_{i=1}^{n}{f(i)}=\sum_{n}{\prod{{a_i}^{\left \lfloor \frac{p_i}{2} \right \rfloor}}}\)

\(=\sum_{n}{\sum_{\prod{{a_i}^{\left \lfloor \frac{p_i}{2} \right \rfloor}} \mid d}{\varphi(d)}}\)

\(=\sum_{d=1}^{\left \lfloor \sqrt{n} \right \rfloor}{\varphi(d)\sum_{n}{[d^2\mid n]}}\)$

\(=\sum_{d=1}^{\left \lfloor \sqrt{n} \right \rfloor}{\varphi(d)*\left \lfloor \frac{n}{d^2} \right \rfloor}\)

猜你喜欢

转载自www.cnblogs.com/gmh77/p/11827264.html