Find the sum of all the multiples of 3 or 5 below 1000

319.1k Views Asked by At

How to solve this problem, I can not figure it out:

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 all the multiples of 3 or 5 below 1000.

2

There are 2 best solutions below

8
On BEST ANSWER

The previously posted answer isn't correct. The statement of the problem is to sum the multiples of 3 and 5 below 1000, not up to and equal 1000. The correct answer is \begin{eqnarray} \sum_{k_{1} = 1}^{333} 3k_{1} + \sum_{k_{2} = 1}^{199} 5 k_{2} - \sum_{k_{3} =1}^{66} 15 k_{3} = 166833 + 99500 - 33165 = 233168, \end{eqnarray} where we have the used the identity \begin{eqnarray} \sum_{k = 1}^{n} k = \tfrac{1}{2} n(n+1). \end{eqnarray}

2
On

The multiples of 3 are 3,6,9,12,15,18,21,24,27,30,....

The multiples of 5 are 5,10,15,20,25,30,35,40,45,....

The intersection of these two sequences is 15,30,45,...

The sum of the first numbers 1+2+3+4+...+n is n(n+1)/2.

The sum of the first few multiples of k, say k+2k+3k+4k+...+nk must be kn(n+1)/2.

Now you can just put these ingredients together to solve the problem.


Since we are asked to look for numbers below 1000, we shall look at numbers up to the number 999.

To find n, use 999/3 = 333 + remainder, 999/5 = 199 + remainder, 999/15 = 66 + remainder, by using a*(m*(m+1)/2) , where m=n/a. here a is 3 or 5 or 15, and n is 999 or 1000 but 999 is best, and then sum multiples of 3: $3((333)*(333+1)/2) = 166833$ plus multiples of 5: $5((199)*(199+1)/2) = 99500$; and subtract multiples of 15 $15((66)+(66+1)/2 )= 33165$ to get 233168.