I am looking to evaluate the sum $\sum_{1\leq k\leq mn}\left\{ \frac{k}{m}\right\} \left\{ \frac{k}{n}\right\} .$
Using matlab, and experimenting around, it seems to be $\frac{(m-1)(n-1)}{4}$ when $m,n$ are relatively prime. How can we prove this, and what about the case where they are not relatively prime?
Conjecture: Numerically, it seems that for any $m,n$ we have $\sum_{1\leq k\leq mn}\left\{ \frac{k}{m}\right\} \left\{ \frac{k}{n}\right\} =\frac{(m-1)(n-1)}{4}+C(\gcd(m,n))$ where $C(\gcd(m,n))$ is some constant depending only on the $\gcd(m,n)$.
Additionally: Can we sum this even when it is not a complete interval? Suppose that $0 do we have an exact form for $\sum_{a\leq k\leq b}\left\{ \frac{k}{m}\right\} \left\{ \frac{k}{n}\right\}.$
Remark: In the one variable case we have $\sum_{1\leq k\leq n}\left\{ \frac{k}{n}\right\} =\frac{n-1}{2}$ the sum over an interval $a,b$ has an explicit form.