Mobius inversion and Dirichlet convolution

Multiplicative function (pre-knowledge)

Multiplicative function definitions:
function \ (f (x) \) satisfies \ (gcd (a, b) = 1 \) when, \ (F (ab &) = F (A) F (B) \) then \ (F (X) \) is a multiplicative function

Common multiplicative function (specifically proven Baidu = w =)
  • Euler function \ ([Phi] (n-) \)
    \ ([Phi] (n-) n-* = [pi (PI -. 1) / PI \)
  • Mobius function \ (μ (n) \)
  1. When \ (n \) has a square factor
    as \ (n = Π_ {i = 1} ^ {t} pi ^ {ci} ( n represents t have a mutually homogeneous factor pi, pi is the number of times each ci ) \)
    when a \ (ci> = 2 (i.e. with a square factor) \) , then \ (μ (n) = 0 \)
  2. Otherwise, if the \ (n-\) is \ (K \) a product of a different prime number, \ ([mu] (n-) = (-1) ^ K \)
  • Divisor function
    \ (σ_k (n) \) represents all positive factor \ (K \) th power, and
    \ (σ_0 (n) = d (n) \) represents the number of positive factors
    \ (σ_1 (n) = σ (n-) \) is a positive factor and

    Completely multiplicative function
  • 幂函数
    \(id_k(n) = n^k\)
    \(id_0(n) = 1(n) =1\)
    \(id_1(n) = id(n) = n\)
  • Unit function
    \ (ε (n) = [n = 1] \) : \ (i.e., ε (n) n = 1 only when the value is 1, the other are 0 \)

Dirichlet convolution

Dirichlet convolution
  • Of two arithmetic functions \ (F, G \) , which is defined as a new Dirichlet convolution function \ (F * G \) , satisfies
    \ ((f * g) ( n) = Σ_ {d | n} f ( d) g (n / d)
    \) satisfies the following rules
  • Commutative \ (f * g = g * f \)
  • Associativity \ ((f * g) * h = f * (g * h) \)
  • Distributive property \ (f * (g + h ) = f * g + f * h \)
  • Unit element \ (f * ε = f \ )
  • Important properties: if \ (f, g \) are multiplicative function, then \ (f * g \) is also a multiplicative function

Known multiplicative function \ (f, g \) a \ (1 - n \) values, we can \ (O (nlogn) \) in the time request
an \ ((f * g) \ ) a \ (1 - n \) values

Common Dirichlet convolution
  • \ (D (n-) Σ_ {D = | n-}. 1 \) , i.e. \ (d = 1 * 1 \ )
  • \(σ(n) = ∑_{d|n}d\), 即 \(σ = id ∗ 1\)
  • \ ([Phi] (n-) Σ_ {D = | n-} [mu] (D) n-* / D \) , i.e. \ ([Phi] = [mu] * ID \) : receiving a repulsive principle available
  • \ ([epsilon] (n-) Σ_ {D = | n-} [mu] (D) \) , i.e. \ ([epsilon] = [mu] *. 1 \) : binomial theorem

Mobius inversion

Mobius inversion
  • \ (C = M * 1 \)
  • If the function \ (f, g \) satisfies \ (F (n-) Σ_ = {D |} n-G (D) \) , then \ (g (n) = Σ_ {d | n} μ (d) f (n / d) \)

Proof: \ (G = F *. 1 \) on both sides of the volume \ ([mu] \) to give: \ ([mu] = F * G * U * [mu] * 1⇔ F = G = G * [epsilon] \)

example

YY of GCD
[CQOI2007] remainder sum
[POI2007] Zap-Queries
[National Team] 2154: Crash digital form

Guess you like

Origin www.cnblogs.com/refaint/p/11323962.html