Let $p$ and $q$ are distinct odd primes. Prove:
$$\sum_{i=0}^{\frac{(p-1)}{2}} [\frac{qi}{p}] + \sum_{i=0}^{\frac{(q-1)}{2}} [\frac{pi}{q}] = \frac{(p-1)(q-1)}{4}$$
$[x]$ is the greatest integer less than or equal to $x$
This is confusing to think about, because if we substitute $p = kq + r$, in the original, we have to deal with terms like $\frac{nr}{p}$, which can be anything. And I'm not sure what can be done other than substituting that back
This is one of those theorems where the algebra looks opaque and intimidating at first, but suddenly everything is crystal clear with the right picture.
Imagine drawing the grid of integer lattice points in the plane, and the line $y = px/q.$
Can you think of a geometric interpretation for each of those two sums?