# Evaluate $\lfloor \frac{x}{m} \rfloor + \lfloor \frac{x+1}{m} \rfloor + \dots + \lfloor \frac{x+m-1}{m} \rfloor$

For any $x \in \mathbb{R}$ and $m \in \mathbb{N}$ evaluate $\lfloor \frac{x}{m} \rfloor + \lfloor \frac{x+1}{m} \rfloor + \dots + \lfloor \frac{x+m-1}{m} \rfloor$.

Well if $x=m$ then we obviously have $\lfloor \frac{x}{m} \rfloor + \lfloor \frac{x+1}{m} \rfloor + \dots + \lfloor \frac{x+m-1}{m} \rfloor = 1 + 1 + \dots + 1=m$.

If $x=-m$ then $\lfloor \frac{x}{m} \rfloor + \lfloor \frac{x+1}{m} \rfloor + \dots + \lfloor \frac{x+m-1}{m} \rfloor=-m$.

If $x=0$ then $\lfloor \frac{x}{m} \rfloor + \lfloor \frac{x+1}{m} \rfloor + \dots + \lfloor \frac{x+m-1}{m} \rfloor=0$.

There are many such cases I can think of, but something tells me there might be an easier solution.

-
this fucntion is periodic $f(x)=f(x+m)$ so you could try a Fourier series representation for it – Jose Garcia Oct 11 '13 at 16:06

This is known as Hermite's identity. The result will always be $\lfloor x \rfloor$.