I am truing to prove that the size of the set:
$$R(n,r)=\left\{1\leq x\leq n: \left\lfloor \frac{(x-1)r}{n}\right\rfloor<\left\lfloor \frac{xr}{n}\right\rfloor \right\}$$ is exactly $r$, where $r<n$. This shouldn't be so difficult but for some reason I am struggling.
$n,x,r$ are all integers.
I appreciate any answer!
Hint: Show that the difference between consecutive terms of $ \lfloor \frac{ x r } { n } \rfloor $ is either 0 or 1.
Since $\lfloor \frac{ 1\times r } { n } \rfloor = 0$ and $\lfloor \frac{ n\times r } { n } \rfloor = r$, there are exactly $r$ times when the difference is exactly 1.
Thus, the set has size $r$.