Summation of Floor Function series Let $p, q$ be co-prime natural numbers. Show that they satisfy : $$\sum_{k=1}^{q-1}\left\lfloor\frac{kp}{q}\right\rfloor=\sum_{k=1}^{p-1}\left\lfloor\frac{kq}{p}\right\rfloor=\frac{(p-1)(q-1)}{2}$$
There exists a proof using lattice points. 
But I would like to see a normal proof using the basic way of solving integer functions like taking $\left\lfloor\frac{p}{q}\right\rfloor = x$, i.e, $p=qx+r \ni r < x$ and then substitution or whatsoever.

In case someone is interested in the lattice proof, here it goes:
Consider a the lattice points with $1\leq x \leq q-1, 1\leq y \leq p-1$. They lie inside the rectangle $OABC$ where $O$ is the origin, $OA=x-\text {axis}$ and $OB=y-\text {axis}$. Here, $|OA|=q, |OC|=p$. None of the considered lattice points $\in$ diagonal $OB$. This would contradict $\gcd(p,q)=1$. We doing the number of lattice points below $OB$ in two ways: 
1) $\text {Their count is } \dfrac{1}{2}(p-1)(q-1)$
2) $\text {It equals} \displaystyle\sum_{k=1}^{q-1}\left\lfloor\frac {kp}{q}\right\rfloor$
 A: You can prove it simply using the fact that $\lfloor x \rfloor + \lfloor -x \rfloor = -1$ for $x \notin \mathbb Z$. Clearly $kp/q \notin \mathbb Z$ for $1 \le k \le q-1$ since $p$ and $q$ are coprime. Hence
\begin{align}
\sum_{k=1}^{q-1} \left\lfloor \frac{kp}q \right\rfloor &= \sum_{k=1}^{q-1} \left\lfloor \frac{(q-k)p}q \right\rfloor = \sum_{k=1}^{q-1} \left( p + \left\lfloor -\frac{kp}q \right\rfloor \right) = \sum_{k=1}^{q-1} \left( p - 1 - \left\lfloor \frac{kp}q \right\rfloor \right) \\
&= (p-1)(q-1) - \sum_{k=1}^{q-1} \left\lfloor \frac{kp}q \right\rfloor,
\end{align}
where we just changed dummy index $k \to q-k$ in the first step. Solving yields
\begin{equation}
\sum_{k=1}^{q-1} \left\lfloor \frac{kp}q \right\rfloor = \frac12(p-1)(q-1).
\end{equation}
A: Suppose that $q$ is odd and $q=2n+1$. For $k$ a positive integer let 
\begin{eqnarray*}
kp \equiv j \pmod{q} 
\end{eqnarray*}
with $0<j<q$  (and $0<q-j<q$) so $kp=j+lq $ (for some $l$) and   $ \left \lfloor \frac{kq}{q} \right \rfloor =l$.
Now $(2n-k)p = (p-l-1)q +q-j $ so $ \left \lfloor \frac{(2n-k)q}{q} \right \rfloor =p-l-1$.
\begin{eqnarray*}
\sum_{k=1}^{2n} \left \lfloor \frac{kq}{q} \right \rfloor= \sum_{k=1}^{n} \left(\left \lfloor \frac{kq}{q} \right \rfloor+ \left \lfloor \frac{(2n-k)q}{q} \right \rfloor  \right)= n(p-1).
\end{eqnarray*}
A: $p=qx+r\quad ,\ r\in\{1,..,q-1\}\ ,x\in\mathbb N\quad$ ($r\neq 0$ since co-primes)
$\displaystyle \sum\limits_{k=1}^{q-1}\lfloor\frac {kp}q\rfloor=\sum\limits_{k=1}^{q-1}kx+\sum\limits_{k=1}^{q-1}\lfloor k\frac rq\rfloor=\frac{(q-1)qx}2+\sum\limits_{k=1}^{q-1}\lfloor k\frac rq\rfloor=\frac{(q-1)(p-r)}2+\sum\limits_{k=1}^{q-1}\lfloor k\frac rq\rfloor$
So this approach does not solve anything, it only reduces the problem to a fraction $\frac rq$ where $r<q$.


*

*since then $\frac{(q-1)(p-r)}2+\frac{(q-1)(r-1)}2=\frac{(q-1)(p-1)}2$ 

