求 egin{equation*}sum_{i=1}^nsum_{j=1}^m[gcd(i,j)=k]end{equation*} 的值.
莫比乌斯反演吧.
egin{align*}
&=sum_{i=1}^{leftlfloorfrac n k
ight
floor}sum_{j=1}^{leftlfloorfrac m k
ight
floor}sum_{d|gcd(i,j)=1}mu(d)\
&=sum_{i=1}^{leftlfloorfrac n k
ight
floor}sum_{j=1}^{leftlfloorfrac m k
ight
floor}sum_{d|gcd(i,j)=1}mu(d)\
&=sum_{i=1}^{leftlfloorfrac n k
ight
floor}sum_{j=1}^{leftlfloorfrac m k
ight
floor}sum_{d|i}sum_{d|j}mu(d)\
&=sum_{i=1}^{leftlfloorfrac n k
ight
floor}sum_{d|i}sum_{j=1}^{leftlfloorfrac m k
ight
floor}sum_{d|j}mu(d)\
&=sum_{d=1}^{minleft(leftlfloorfrac n k
ight
floor,leftlfloorfrac m k
ight
floor
ight)}mu(d)sum_{i=1}^{leftlfloorfrac n k
ight
floor}sum_{d|i}sum_{j=1}^{leftlfloorfrac m k
ight
floor}sum_{d|j}1\
&=sum_{d=1}^{minleft(leftlfloorfrac n k
ight
floor,leftlfloorfrac m k
ight
floor
ight)}mu(d)sum_{i=1}^{leftlfloorfrac n k
ight
floor}sum_{d|i}1sum_{j=1}^{leftlfloorfrac m k
ight
floor}sum_{d|j}1\
&=sum_{d=1}^{minleft(leftlfloorfrac n k
ight
floor,leftlfloorfrac m k
ight
floor
ight)}mu(d)leftlfloorfrac{leftlfloorfrac n k
ight
floor}d
ight
floorleftlfloorfrac{leftlfloorfrac m k
ight
floor}d
ight
floor\
&=sum_{d=1}^{minleft(leftlfloorfrac n k
ight
floor,leftlfloorfrac m k
ight
floor
ight)}mu(d)leftlfloorfrac n{kd}
ight
floorleftlfloorfrac m{kd}
ight
floor\
end{align*}