Number Theory and collection function prefix

01 - \(\sum\limits_{i=1}^{n} [gcd(i,m)=1]\)

Index: the number n less than the number m coprime

求:\(\sum\limits_{i=1}^{n} [gcd(i,m)=1]\)

  1. \(\sum\limits_{d|n}\mu(d)=[n=1]\)
    \(\sum\limits_{i=1}^{n} \sum\limits_{d|gcd(i,m)}\mu(d)\)
  2. Switching sequence summing give
    \ (\ sum \ limits_ {d | m} \ mu (d) \ lfloor \ frac {n} {d} \ rfloor \)
  3. When d has a square noted factor \ (\ MU (d) = 0 \) , then obtains \ (m \) all prime factors and inclusion-exclusion (in fact Möbius function itself represents inclusion and exclusion)
  4. 64-bit integer range prime factors of less than 20 species, inclusion and exclusion complexity does not exceed 1e6 single.

And when n is equal to m, \ (\ varphi (n) = \ SUM \ limits_. 1 = {I} ^ {n} [GCD (I, n) =. 1] \) , for the definition of the Euler function. Can be obtained \ (\ varphi (n) = \ sum \ limits_ {d | n} \ mu (d) \ frac {n} {d} \) i.e. \ (\ frac {\ varphi ( n)} {n} = \ sum \ limits_ {d | n} \ frac {\ mu (d)} {d} \)

Guess you like

Origin www.cnblogs.com/KisekiPurin2019/p/12241952.html