Write α=a/q+β, where ∣β∣≤q−2. Split the m-interval into O(M/q+1) consecutive blocks of length at most q/2. If distinct integers m,n lie in one block, then 0<∣m−n∣<q/2. Since (a,q)=1,
The points αm in one block are therefore 1/(2q)-separated modulo one. Order them by distance from the nearest integer. Apart from a bounded number of endpoints, the jth closest point has distance ≫j/q, and consequently
∑m in one blockmin(R,∥αm∥−1)≪R+q∑1≤j≤qj1≪R+qlogq.