If we list every the natural numbers below 10 that room multiples that 3 or 5, we obtain 3, 5, 6 and 9. The amount of this multiples is 23.

You are watching: Sum of multiples of 3 and 5 below 1000

Find the sum of all the multiples the 3 or 5 listed below 1000.  The previously posted answer isn"t correct. The explain of the difficulty is to amount the multiples the 3 and 5 listed below 1000, no up to and equal 1000. The exactly answer isegineqnarraysum_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,endeqnarraywhere we have the provided the identityegineqnarraysum_k = 1^n k = frac12 n(n+1).endeqnarray \$egingroup\$ The one that posted the prize 233168, please define that price in detail . It would certainly be really helpful for us if you will explain. \$endgroup\$
First that all, prevent thinking ~ above the number \$1000\$ and also turn your attention to the number \$990\$ instead. If you deal with the trouble for \$990\$ friend just have to add \$993, 995, 996\$ & \$999\$ come it for the final answer. This sum is \$(a)=3983\$

Count all the #s divisible through \$3\$: native \$3\$... Come \$990\$ there are \$330\$ terms. The sum is \$330(990+3)/2\$, for this reason \$(b)=163845\$

Count every the #s divisible by \$5\$: native \$5\$... Come \$990\$ there space \$198\$ terms. The amount is \$198(990+5)/2\$, therefore \$(c)=98505\$

Now, the GCD (greatest usual divisor) that \$3\$ & \$5\$ is \$1\$, therefore the LCM (least typical multiple) have to be \$3 imes 5 = 15\$.

This way every number the divides through \$15\$ was counted twice, and also it must be done just once. Due to the fact that of this, you have an extra collection of numbers began with \$15\$ all the method to \$990\$ that needs to be gotten rid of from (b)&(c).

Then, from \$15\$... To \$990\$ there room \$66\$ terms and their sum is \$66(990+15)/2\$, therefore \$(d)=33165\$

The answer for the problem is: \$(a)+(b)+(c)-(d) = 233168\$

Simple but really fun problem.

re-superstructure
mention
follow
edited Feb 22 "14 in ~ 11:55 hardyellowcomic.com
answer Feb 22 "14 at 9:13 agilaagila
\$endgroup\$
2
include a comment |
15
\$egingroup\$
The multiples the 3 space 3,6,9,12,15,18,21,24,27,30,....

The multiples the 5 space 5,10,15,20,25,30,35,40,45,....

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

The amount of the an initial numbers 1+2+3+4+...+n is n(n+1)/2.

The amount of the first couple of multiples of k, to speak k+2k+3k+4k+...+nk have to be kn(n+1)/2.

Now you can just put these ingredients with each other to deal with the problem.

Since we space asked come look for numbers below 1000, us shall look in ~ numbers up to the number 999.

To find n, usage 999/3 = 333 + remainder, 999/5 = 199 + remainder, 999/15 = 66 + remainder, by using a*(m*(m+1)/2) , whereby m=n/a. Here a is 3 or 5 or 15, and n is 999 or 1000 however 999 is best, and also then amount multiples the 3: \$3((333)*(333+1)/2) = 166833\$ add to multiples of 5: \$5((199)*(199+1)/2) = 99500\$; and also subtract multiples the 15 \$15((66)+(66+1)/2 )= 33165\$ to gain 233168.

share
point out
monitor
edited january 28 "20 in ~ 5:50
Mahesh muttinti
322 bronze title
reply Nov 7 "10 in ~ 12:36
anonanon
\$endgroup\$
2
9
\$egingroup\$
Well the key equation is already given above. The just question which provide me trouble is that why I have to subtract the sum of 15?! Well, the prize is, 15 can be evenly division by both 3 & 5. For this reason the commodities of 15 can also be split by those number as well! So, when you adding the number with sum Of 3 & sum Of five there space some numbers(i.e. 15,30,45,60....) i m sorry are available at both SUMMATION. So, you need to subtract at least once native the total sum to get the answer!

Hope this help someone favor me:) !!

share
mention
follow
answered Dec 28 "13 in ~ 11:22
enamenam
\$endgroup\$
Highly energetic question. Earn 10 reputation (not counting the combination bonus) in order to answer this question. The reputation necessity helps protect this inquiry from spam and also non-answer activity.

## Not the price you're feather for? Browse other questions tagged number-theory project-euler or ask your own question.

Upcoming occasions
Featured ~ above Meta
7
What is the sum of every the organic numbers between \$500\$ and also \$1000\$.

See more: How Long Is A Block In Nyc, How Long Is A Standard City Block

4
Find the sum of every the multiples that 3 or 5 below 1000 (Break down)
connected
9
when do the multiples of 2 primes expectations all large enough natural numbers?
13
find the sum of the digits in the number 100!
1
CS problem, turned to yellowcomic.comematics
4
discover the amount of all the multiples that 3 or 5 listed below 1000 (Break down)
0
possible mis-interpretation in project Euler #21
3
Minimum amount of integers no multiples the one another.
2
recognize the sum of 3 numbers v 5 positive integer divisors.
hot Network inquiries more hot inquiries
inquiry feed

yellowcomic.com
company
ridge Exchange Network
site design / logo © 2021 ridge Exchange Inc; user contributions licensed under cc by-sa. Rev2021.11.12.40742

yellowcomic.comematics ridge Exchange works best with JavaScript allowed 