Exercise 1.2.5 (Number of multiples of $7$)

How many integers between 100 and 1000 are divisible by 7 ?

Answers

Proof. The number N of integers x between 100 and 1000 which are divisible by 7 is the number of integers k such that

100 7 k 1000 . (1)

Since 7 100 , this condition is equivalent to

100 7 < k 1000 7 . (2)

Note that for x and k ,

x < k x + 1 k ,

and

k x k x .

So the condition (2) is equivalent to

100 7 + 1 k 1000 7 . (3)

Therefore

N = 1000 7 100 7 = 142 14 = 128 .

Check:

 counter = 0
 for x in range(100,1001):
     if x % 7 == 0:
         counter += 1
 print(counter)
                             128

User profile picture
2024-06-16 10:19
Comments