What is the sum of all multiples of 3 and 5 below 100?

What is the sum of all multiples of 3 and 5 below 100?

These are the numbers 0,1,2,3,…,66, multiplied by 15. Their sum is or 33165. The final sum is 166833+99500-33165 or 233168. You can try and compile the C code to check my final result.

How do you find the sum of multiples of 3?

Consider the first 5 multiples of 3 that is: 3, 6, 9, 12, 15 which is same as 3 multiplied by the first 5 integers (1, 2, 3, 4, 5). We know the sum of first 5 integers as 5 * 4/2 = 10. So, the sum of first 5 multiples of 3 is 3 * 10 that is 30.

How do you find the multiples of 3 below 1000?

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.

What is the sum of all multiples of 3 between 1 and 100 *?

Hence, the sum of multiples of 3 between 1 and 100 = 1683.

What is the sum of all 3 digit multiples of 3 or 5?

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.

What is the sum of the 3rd and 7 multiple of 9?

Sum of 3rd and 7th multiple of 9 is 90.

How to find sum of multiples of 3 or 5 below 1000?

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. The program works fine. What I want to get from a code review:

Which is the correct sum of 3 and 5?

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 ∑ k = 1 n k = 1 2 n ( n + 1).

How to find the sum of all the numbers above 1000?

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.

What is the number of multiples of 3?

If number is 10 then multiple of 3 is 3,6,9 and multiple of 5 is 5,10 total sum is 33 and program gives same answer: