A valid floor function trick? Given $x\in\mathbb R_+$ and $m,n\in\mathbb Z_+$, is it true that
$$\bigg\lfloor\frac{\lfloor \frac{x}{m}\rfloor}{n}\bigg\rfloor=\bigg\lfloor \frac{x}{mn}\bigg\rfloor?$$



Thanks for at least three different and convincing proofs! I'll use this result  trying to code the prime counting formula from Wikipedia $(2)$:

Given $m$, select $y$ so that 
$\sqrt[3]{m}\le y\le\sqrt{m}$ and let $n=\pi(y)$. Then

$(1)\;$ $\pi(m)=\phi(m,n)+n-1-P_2(m,n)$, where

$(2)\;$ $\displaystyle \phi(m,n)=\phi(m,n-1)-\phi\Big(\frac{m}{p_n},n-1\Big)$, 
$\;\phi(m,0)=\lfloor{m}\rfloor$ and

$(3)\;$ $\displaystyle P_2(m,n)=\sum_{y&lt;p\le\sqrt{m}}
\Big(\pi\Big(\frac{m}{p}\Big)-\pi(p)+1\Big)$, $\;p$ is a prime.
Yes it is. Assume it is not, then there is an integer $N\in\mathbb{N}$ that lies between $\left\lfloor\frac{\left\lfloor\frac{x}{m}\right\rfloor}{n}\right\rfloor$ and $\left\lfloor\frac{x}{mn}\right\rfloor$.
Possible cases:


$$\frac{x}{mn}&lt;N\leq\frac{\left\lfloor\frac{x}{m}\right\rfloor}{n} \implies \frac{x}{m}&lt;nN\leq\left\lfloor\frac{x}{m}\right\rfloor,$$
which is a contradiction, since $\left\lfloor\frac{x}{m}\right\rfloor\leq\frac{x}{m}$.
$$\frac{\left\lfloor\frac{x}{m}\right\rfloor}{n}&lt;N\leq\frac{x}{mn} \implies \left\lfloor\frac{x}{m}\right\rfloor&lt;nN\leq\frac{x}{m},$$
which is also a contradiction, since there cannot lie an integer between $\left\lfloor\frac{x}{m}\right\rfloor$ and $\frac{x}{m}$.
We know that if |x-y|&lt;1  (x>y)  then [x] = [y]

[x/m] - x/m &lt;1 : [x/m]/n - x/mn = ([x/m] - x/m ) /n &lt;1 

So | [x/m] / n  -  x/ mn | &lt;1  so your trick is correct