[Math] Let n and d be positive integers. How many positive integers not exceeding n are divisible by d

divisibility

There is a discussion in my book that, despite my best efforts, I was unable to understand. The problem asks:

Let $n$ and $d$ be positive integers. How many positive integers not exceeding $n$ are divisible by $d$?

enter image description here

I understood everything except the part where the floor function is applied. I know that if an integer is divisble by $d$, then it is of the form $dk$ for some integer $k$ by definition of divisibility. I also understand that because $n$ and $d$ are positive integers, $k$ must be a positive integer, so $dk > 0$. "Not exceeding $n$" translates to $\leq n$.

But what is the logic behind the floor function? I know what it does: it returns the greatest integer less than or equal to the input. But how does using it allow us to determine how many such positive integers fit the given criteria?

Please try to keep your answer as simple as possible. I know most of you guys are professional mathematicians and/or experts, but I'm easily confused 🙂

Best Answer

Let's do a simple example

Suppose $n=16$ and $d=3$. Then $16/3$ is not a whole number, but if we take the floor, then it is $5$. And indeed, there are $5$ positive integers not exceeding $7$ that are divisible by $3$: $3,6,9,12,15$. That is, you get: $3,6,9,12,15,18$ (oh no, wait, $18$ exceeds $16$, so it stops at $15$). Put differently, you get $1\cdot 3, 2\cdot 3, 3\cdot 3, 4\cdot 3, 5\cdot 3$, and that's it, since $6 \cdot 3$ exceeds $16$. But the $5$ is exactly what the floor of $16/3$ gives you.

A little more general: the positive integers not exceeding $n$ but divisible by $d$ are $d,2d,3d,...$. Now, if $n=kd$ for some whole number $k$, then it ends nicely in $n$: $d,2d,3d,...,kd$. But if $n/d$ is not a whole number, then $n=kd+s$ with $s$ some number between $0$ and $d$, so you still you get $d,2d,3d,...,kd$, as the next one $(k+1)d$ would exceed $n$. So you get $k$ divisors, and $\lfloor n/d \rfloor = k$