[SDOI 2014] the number of table

 The meaning of problems

  https://www.luogu.org/problem/P3312

 answer

  Obviously seeking $ \ sum_ {i = 1} ^ {n} \ sum_ {j = 1} ^ {m} \ sigma_1 (\ gcd {(i, j)}) \ times [gcd (i, j) \ le a] $ ($ \ sigma_1 (x) $ find $ x $ express all about and the number of), to see that this is a $ gcd $ Mobius inversion basis of the chase

  If you do not consider limiting the $ a $, which is pushed over the anti-Mo template title, it is not considered

  Original formula becomes $$ \ sum_ {i = 1} ^ {n} \ sum_ {j = 1} ^ {m} \ sigma_1 (\ gcd {(i, j)}) $$

  The number of routine enumerator about $$ \ sum_ {d = 1} ^ {n} \ sum_ {i = 1} ^ {n} \ sum_ {j = 1} ^ {m} \ sigma_1 (d) \ times [gcd (i, j) = d] $$

  The $ \ sigma_1 $ moved to the front, and the classical equation $ \ sum_ | \ mu {( d)} = [n = 1] {d n} $ last inversion of a sigma  $$ \ sum_ {d = 1} ^ {n} \ sigma_1 (d ) \ sum_ {i = 1} ^ {\ lfloor \ frac {n} {d} \ rfloor} \ sum_ {j = 1} ^ {\ lfloor \ frac {m} {d} \ rfloor} \ sum_ {d | \ gcd {(i, j)}} \ mu (d) $$

  $$\sum_{d=1}^{n} \sigma_1(d)\sum_{i=1}^{\lfloor\frac{n}{d}\rfloor} \sum_{j=1}^{\lfloor\frac{m}{d}\rfloor} \sum_{d|i, d|j} \mu(d)$$

  The $ x $ moved to the front

Guess you like

Origin www.cnblogs.com/scx2015noip-as-php/p/luogu3312.html