Mobius inversion brush title record

BZOJ1101: [POI2007]Zap

  • The meaning of problems: for given integers a, b and d, to find the number of positive integers x, y, satisfies x <= a, y <= b, and gcd (x, y) = d
  • Request directly to the number of positive integers x, y, gcd (x, y) = d more difficult to find, and inquired about 50,000,

  •  


    \ begin {gather *}
    claim \ \ \ \ \ \ \ \ f (n) = \ \ sum \ nolimits ^ {\ b} _ {\ y = 1} \ \ \ sum \ nolimits ^ {\ a} _ { \. 1} X = \ [\ GCD (X, Y) = n-\] \\
    \\
    is \ \ \ \ \ \ \ \ \ \ \ F (n) = \ sum \ nolimits ^ {\ b} _ { \ = Y. 1} \ SUM \ NoLimits ^ {\ {A} _ \. 1} X = \ SUM \ NoLimits _ {\ n-| GCD (X, Y)} \. 1 \\
    \\
    as \ \ \ \ \ \ \ \ SUM \ NoLimits _ {\ n-| GCD (X, Y). 1} = \ SUM \ NoLimits _ {\ n-| D} \ [\ GCD (X, Y) = D \] \\
    \\
    F. (n- ) \ = \ \ SUM \ NoLimits _ {\ n-|} D \ \ F (D) \\
    \\
    then is hot Mobius inversion \\
    \\
    \ End Gather *} {

  • Code:

Guess you like

Origin www.cnblogs.com/jiecaoer/p/11586397.html