By definition of modulo 1: :$\displaystyle \sum_{0 \mathop \le k \mathop < n} \left \lfloor{\dfrac {m k + x} n}\right \rfloor = \sum_{0 \mathop \le k \mathop < n} \dfrac {m k + x} n - \sum_{0 \mathop \le k \mathop < n} \left\{ {\dfrac {m k + x} n}\right\}$ where $\left\{ {y}\right\}$ in this context denotes the fractional part of $y$. First we have: {{begin-eqn}} {{eqn | l = \sum_{0 \mathop \le k \mathop < n} \dfrac {m k + x} n       | r = \frac m n \sum_{0 \mathop \le k \mathop < n} k + \sum_{0 \mathop \le k \mathop < n} \dfrac x n       | c =  }} {{eqn | r = \frac m n \frac {n \left({n - 1}\right)} 2 + n \dfrac x n       | c = Closed Form for Triangular Numbers }} {{eqn | r = \frac {m \left({n - 1}\right)} 2 + x       | c =  }} {{end-eqn}} Let $S$ be defined as: :$\displaystyle S := \sum_{0 \mathop \le k \mathop < n} \left\{ {\dfrac {m k + x} n}\right\}$ Thus: :$\displaystyle (1): \quad \sum_{0 \mathop \le k \mathop < n} \left \lfloor{\dfrac {m k + x} n}\right \rfloor = \dfrac {m \left({n - 1}\right)} 2 + x - S$ Let $d = \gcd \left\{ {m, n}\right\}$. Let: {{begin-eqn}} {{eqn | l = t       | r = \frac n d }} {{eqn | l = u       | r = \frac m d }} {{eqn | ll= \leadsto       | l = \frac m n       | r = \frac u t       | c =  }} {{eqn | ll= \leadsto       | l = m t       | r = u n       | c =  }} {{eqn | ll= \leadsto       | l = u       | r = \frac {m t} n       | c =  }} {{end-eqn}} We have that: {{begin-eqn}} {{eqn | l = \left\{ {\dfrac {m k + x} n}\right\}       | r = \left\{ {\dfrac {m k + x} n + u}\right\}       | c = {{Defof|Fractional Part}}: $u$ is an integer }} {{eqn | r = \left\{ {\dfrac {m k + x} n + \frac {m t} n}\right\}       | c =  }} {{eqn | r = \left\{ {\dfrac {m \left({k + t}\right) + x} n}\right\}       | c =  }} {{end-eqn}} Thus $S$ consists of $d$ copies of the same summation: {{begin-eqn}} {{eqn | l = S       | r = \sum_{0 \mathop \le k \mathop < n} \left\{ {\dfrac {m k + x} n}\right\}       | c =  }} {{eqn | r = d \sum_{0 \mathop \le k \mathop < t} \left\{ {\dfrac {m k + x} n}\right\}       | c =  }} {{end-eqn}} and so: {{begin-eqn}} {{eqn | l = \sum_{0 \mathop \le k \mathop < t} \left\{ {\dfrac {m k + x} n}\right\}       | r = \sum_{0 \mathop \le k \mathop < t} \left\{ {\dfrac x n + \dfrac {u k} t}\right\}       | c = substituting $\dfrac u t$ for $\dfrac m n$ }} {{eqn | r = \sum_{0 \mathop \le k \mathop < t} \left\{ {\dfrac {x \bmod d} n + \dfrac k t}\right\}       | c = as $t \perp u$ }} {{eqn | r = \sum_{0 \mathop \le k \mathop < t} \dfrac {x \bmod d} n + \dfrac k t       | c = as $\dfrac {x \bmod d} n < \dfrac 1 t$ }} {{eqn | r = t \dfrac {x \bmod d} n + \frac 1 t \sum_{0 \mathop \le k \mathop < t} k       | c =  }} {{eqn | r = \dfrac {t \left({x \bmod d}\right)} n + \frac 1 t \frac {t \left({t - 1}\right)} 2       | c = Closed Form for Triangular Numbers }} {{eqn | r = \dfrac {t \left({x \bmod d}\right)} n + \frac {t - 1} 2       | c =  }} {{eqn | ll= \leadsto       | l = S       | r = d \left({\dfrac {t \left({x \bmod d}\right)} n + \frac {t - 1} 2}\right)       | c =  }} {{eqn | r = \dfrac {n \left({x \bmod d}\right)} n + \frac {n - d} 2       | c = as $n = d t$ }} {{eqn | r = x \bmod d + \frac {n - d} 2       | c =  }} {{end-eqn}} {{explain|Greater detail needed as to why $\displaystyle \sum_{0 \mathop \le k \mathop < t} \left\{ {\dfrac x n + \dfrac {u k} t}\right\} {{=}} \sum_{0 \mathop \le k \mathop < t} \left\{ {\dfrac {x \bmod d} n + \dfrac k t}\right\}$}} Thus: {{begin-eqn}} {{eqn | l = \sum_{0 \mathop \le k \mathop < n} \left \lfloor{\dfrac {m k + x} n}\right \rfloor       | r = \frac {m \left({n - 1}\right)} 2 + x - S       | c = from $(1)$ }} {{eqn | r = \frac {m \left({n - 1}\right)} 2 + x - d \left({\dfrac {t \left({x \bmod d}\right)} n + \frac {t - 1} 2}\right)       | c =  }} {{eqn | r = \frac {m \left({n - 1}\right)} 2 + x - x \bmod d - \frac {n - d} 2       | c =  }} {{eqn | r = \frac {m \left({n - 1}\right)} 2 + x - x + d \left \lfloor{\frac x d}\right \rfloor - \frac {n - 1} 2 + \frac {d - 1} 2       | c = {{Defof|Modulo Operation}} and algebra }} {{eqn | r = \frac {\left({m - 1}\right) \left({n - 1}\right)} 2 + \frac {d - 1} 2 + d \left \lfloor{\frac x d}\right \rfloor        | c = simplification }} {{end-eqn}} {{qed}}