题意:求\[\sum_{i=1}^{n}\sum_{j=1}^{m}[gcd(i,j) = prim]\]
题解:那就开始化式子吧!!
\[f(d) = \sum_{i=1}^{n}\sum_{j=1}^{m}[gcd(i,j) = d]\]
\[F(x) = \sum_{d|x} f(d) = \left \lfloor \frac{n}{x} \right \rfloor \left \lfloor \frac{m}{x} \right \rfloor\]
\[f(d) = \sum_{d|x} \mu\left ( \frac{x}{d} \right )F(x) \]
\[ans = \]
原文地址:https://www.cnblogs.com/lwqq3/p/10346545.html
时间: 2024-10-08 05:28:28