I'm self-studying number theory using "A Computational Introduction to Number Theory and Algebra" by Victor Shoup, and this trivially-looking exercise throws me off:
Let $m$ $\in$ $\mathbb{Z}$, $m$ $\gt$ 0; $x$ $\in$ $\mathbb{R}$, $x$ $\ge$ 1. Show that the number of multiples of $m$ in $[1, x]$ is $\lfloor \frac{x}{m} \rfloor$
Let's take $x = 4.0$ and $m = 2$. Then $\lfloor \frac{x}{m} \rfloor = 2$. But I don't see two multiples of $m$ in $[1, 4.0]$:
- first multiple goes from 1 to 3
- second multiple goes from 3 to 5, and 5 $\notin [1, 4.0]$
What am I missing? This feels so elementary I'm even ashamed of asking
I see exactly two multiples of $2$ in $[1,4]$: $2$ and $4$. Which concept of multiple are you using?
In the general case, the multiples of $m$ in $[1,x]$ are $m,2m,\ldots,\left\lfloor\frac xm\right\rfloor$. The nest multiple of $m$ is $\left(\left\lfloor\frac xm\right\rfloor+1\right)m$, which is greater than $x$.