# Question about floor function $\lfloor nx\rfloor$ and what it equals

Let $f(x): \Bbb R \to \Bbb Z: x\to \lfloor x \rfloor$ be the floor function which gives the first real number that is less than or equal to $x$. And we also have $n$ which is a natural number (it belongs to $\Bbb N$ i.e. $1,2,3,4,...$). I want to find what $\lfloor nx\rfloor$ equals to. ($n$ is natural but $x$ is real)

For example, I know that $\lfloor 2x\rfloor = \lfloor x\rfloor +\lfloor x+1/2\rfloor$. I want to know is this equation right or not? $\lfloor nx\rfloor =(n-1)\lfloor x\rfloor + \lfloor x+\frac{n-1}{n}\rfloor$. If it is true, then I want a proof. If it is not, then my question is does $\lfloor nx\rfloor$ has any formula like $\lfloor 2x\rfloor$ or not?

• In general, we have $$\lfloor nx\rfloor=\sum_{k=0}^{n-1}\left\lfloor x+\frac kn\right\rfloor~~\forall~x\in\Bbb R~\forall~n\in\Bbb N$$ This is known as Hermite's identity. – Prasun Biswas Oct 6 '17 at 13:16
• Possible duplicate of [Floor function properties: $[2x] = [x] + [ x + \frac12 ]$ and $[nx] = \sum_{k = 0}^{n - 1} [ x + \frac{k}{n} ]$](math.stackexchange.com/questions/184361/…) – Guy Fsone Oct 6 '17 at 13:39

$$\left\lfloor nx\right\rfloor=\left\lfloor x\right\rfloor+\left\lfloor x+\frac1n\right\rfloor+\left\lfloor x+\frac2n\right\rfloor+\cdots\left\lfloor x+\frac{n-1}n\right\rfloor.$$
Because the LHS increases by one when $x$ crosses $\dfrac kn$ for some $k$, which causes a single term in the RHS to also increase by $1$. (And the identity holds for $x=0$.)