# A problem on floor function

Find $m,n\in \mathbb{Z}$ s.t.

$$\sum\limits_{k = 0}^{mn - 1} {\left( { - 1} \right)^{\left\lfloor {\frac{k} {m}} \right\rfloor + \left\lfloor {\frac{k} {n}} \right\rfloor } } = 0$$ See here for motivation, I said something there that I can not understand now

• It is easy to see that $m\,n-1$ must be even, and this implies that $m$ and $n$ must be odd. A little experimentation suggest that the solution is all pairs $(m,n)$ with $m,n$ odd $\ge3$ and $\gcd(m,n)=1$. – Julián Aguirre Jun 19 '17 at 10:55