Sum over k to p over 2 of Floor of 2kq over p

Theorem
Let $p \in \Z$ be an odd prime.

Let $q \in \Z$ be an odd integer.

Then:
 * $\displaystyle \sum_{0 \mathop \le k \mathop < p / 2} \floor {\dfrac {2 k q} p}r \equiv \sum_{0 \mathop \le k \mathop < p / 2} \floor {\dfrac {k q} p} \pmod 2$

Proof
When $k < \dfrac p 4$ we have:

Thus it is possible to replace the last terms:
 * $\floor {\dfrac {\paren {p - 1} q} p}, \floor {\dfrac {\paren {p - 3} q} p}, \ldots$

by:
 * $\floor {\dfrac q p}, \floor {\dfrac {3 q} p}, \ldots$

The result follows.