Number of multiples of m among integer interval $[\![ 1,n ]\!]$

98 Views Asked by At

Can you show me how to solve this question?

For positive integers $m$ and $n$,show that the number of multiples of $m$ among $1, 2,...,n$ is $$ \lfloor n / m \rfloor $$ More generally, for an integer $m$ and real $x \geq 0$, show that the number of multiples of $m$ in the interval $[1, x]$ is $$ \lfloor x/m \rfloor$$


I started with $$ 1 \le km \le n $$ $$ 1/m \le k \le n/m $$ but I couldn't go even one more step.

1

There are 1 best solutions below

0
On

Let $a$ be the unique integer such that $a\le x<a+1$.

Then $\lfloor\frac{a}{m}\rfloor \le \lfloor\frac{x}{m}\rfloor < \lfloor\frac{a+1}{m}\rfloor$.

Therefore $\lfloor\frac{x}{m}\rfloor =\lfloor\frac{a}{m}\rfloor$.