Here it is 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.
@dan815
sum of multiples of 3 + sum of multiples of 5 - sum of multiples of 15
lol
each of them is an arithmetic series
i did this already
u add the sums of 3 and sums of 5 and subtract the sums of 15
@hartnn dan gave me a link to solve math problem and I failed at the first question (this one) he laughed at me, hehehe
there are 333 terms that 3 can produce below 1000 and there are 199 terms 5 can produve below 1000 and there are 1000/15 -1 terms produced by 15
i can show u my code but its a little uugglaayy
how can you know there are 333 terms of 3?
1000/3
333*3=999 is the last term
1000/5 =200 1000 is the lst term and total 200 terms
oooh, there is a method !!!
*below* so 995 last term and 199 terms
hartn come join us!! on our programming journey
thre's always a method xD
i'm doing enough programming for y work. :P no more programming while i enjoy my hobby :)
so, it is 330 + 199 -5 ??
whats that ?
oh 333 +190-5
you're counting no. of terms? why ??
you said so
take each series as separate arithmetic series
series 1 3+6+9+..999 a1 = 3, d = 3, n= 333 sum =...
y=[] x=[] for i in range(334): a=3*i y.append(a) for i in range(200): b=5*i x.append(b) for i in range(67): x[3*i]=0 ans=sum(x) print ans
series 2 5+10+15+..995 a1= 5,d=5, n = 199 sum2 =...
paste that code on that site and click excecute
see if it works
yes, I got it, thanks @hartnn
hartnn do u know python
did u get why do we do this ? sum of multiples of 3 + sum of multiples of 5 - sum of multiples of 15
yes, I got the idea. hartnn
yes, i've learned python like a month ago, and i use it in my work
yha loser do u get that
you are adding that sum twice because once for 5 * k3 and 3*k5
why for 15 you have to -1 term?
are you using my code
download python its free!
15|1000= 66.6666 so, the last term is 975., still <1000, why you have to -1?
its the easiest language to do some quick alogorythms
I don't know python. dan. I use calculator
lol
o mg plz dont!
you will get so stuck! this site teaches you some neat math after you solve it will show you more efficient ways
why??? when I studiedcomputer, I tried to understand the way the computer works, I asked and my prof hid himself to me, hahahaha...,
hahaha
look at this question! okay
OK, I will try python, but now, explain me. why you -1 from 15
what u mean
download python so u can run my code and see
15|1000 -1 term
i use 66
15*66 = 990
yes, Sir
so x=[] for i in range(67): % this range 67 makes numbers go only to 67-1 = 66 a=15*i x.append(a) % keeps adding every multiply of 15 to the list x
another way is to just ssum as you get them
sum1=0 for i in range(67): sum1=sum1+15*i
sum1 will contain the addition of all the multiles of 15* 1 to 15*66
sum1=0 for i in range(200): sum1=sum1+5*i sum2=0 for i in range(334): sum1=sum1+3*i sum3=0 for i in range(67): sum1=sum1+15*i ans = sum1+sum2-sum3
this is a another complete CODE i just wrote up for u :) ENJOOOYy
got you, dan
sum1=0 for i in range(200): sum1=sum1+5*i sum2=0 for i in range(334): sum2=sum2+3*i sum3=0 for i in range(67): sum3=sum3+15*i ans = sum1+sum2-sum3
forgot to replace the numbers beside the sum :)
hey
do this question umm
lets derive the sum of 1^2+2^2+3^2....+100^2 with a formula
233168
no i want formula
1^2+2^2+...n^2 = ?
ohh u mean u solved the fisrt question ok
brb eating
this is answer for question 1 : 233168
me too. I go to "iit" something
look at question 7
no look at question 6
derive sum of square formula im eating
Join our real-time social learning platform and learn together with your friends!