Find the sum of the multiples of 3 or 7 under 875
For example, if we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
Find the sum of the multiples of 3 or 7 under 875?
- Posted:
- 3+ months ago by malektannir
- Topics:
- natural, number, multiple, under, below, example, numbers, algebra
Answers (1)
DIV = integer division operator
R = remainder
875 DIV 3 = 291, R=2, so there are 291 multiples m of 3 that meet the condition
3m < 875.
875 DIV 7 = 125, R=0 so in order to meet the condition we have to subtract 1. There are 124 multiples of 7, such that 7m < 875.
----------
The sum of multiples of 3:
3 ⋅ 1 + 3 ⋅ 2 + 3 ⋅ 3 + ... + 3 ⋅ 291 = 3 ⋅ (1 + 2 + 3 + ... + 291) =
3 ⋅ (291 ⋅ 292) / 2 = 127458.
-----------
The sum of multiples of 7, likewise:
7 ⋅ ∑ (124) = 54250.
----------
127458 + 54250 = 181708 (intermediate total).
Now, 3 ⋅ 7 = 7 ⋅ 3 = 21 . But we don't want double counts. So, we have to subtract from our intermediate total 21 ⋅ ∑ (41) = 18081 (as 875 DIV 21 = 41, R=14. Btw,
21 ⋅ ∑ (41) = 18081 is the sum of the multiples of 3 AND 7 under 875).
Finally, the sum of the multiples of 3 OR 7 under 875 is:
181708 - 18081 = 163627.