Mujklob Posted December 24, 2007 Report Share Posted December 24, 2007 What is the sum of all the natural numbers below 1000 that are multiples of 3 or 5? Quote Link to comment Share on other sites More sharing options...
-PHXN- New001 Posted December 25, 2007 Report Share Posted December 25, 2007 I just googled it XDSo I won't wreck it for others. Quote Link to comment Share on other sites More sharing options...
Vameq Posted March 2, 2008 Report Share Posted March 2, 2008 too much thinking...i'd have to remove data of hunter dps, nightelves, blizzards, and final fantasy tactics job combinations to figure it out without wasting time =/ Quote Link to comment Share on other sites More sharing options...
Citizenmanman Posted March 14, 2008 Report Share Posted March 14, 2008 Sum of numbers up to 1000 = (1/2)*1000*1001 = 500500Sum of numbers divisible by 2 up to 1000 = 2*(1+2+...500) = 2*(1/2)*500*501 = 250500Sum of numbers divisible by 5 up to 1000 = 5*(1+2+...200) = 5*(1/2)*200*201 = 100500Sum of numbers divisible by both 2 and 5 up to 1000= 10*(1+2+3+...100) = 10*(1/2)*100*101 = 50500Required sum = 500500 - 250500 - 100500 + 50500 = 200000 Quote Link to comment Share on other sites More sharing options...
BigNeckLawnBoy Posted March 22, 2015 Report Share Posted March 22, 2015 MY HEAD! 1 Quote Link to comment Share on other sites More sharing options...
professa X Posted October 5, 2015 Report Share Posted October 5, 2015 Wow. Just write up a simple code. Had an interview question just like this.Int main (){ Int sum=0; For (int I=0; I< 1000;I++) { If (i%3==0 || i%5 ==0) Sum += I; } Print (sum)Return 0;} Quote Link to comment Share on other sites More sharing options...
ElementalCards Posted October 6, 2015 Report Share Posted October 6, 2015 MY HEAD! What was once a math wizard, I became a total dope afterwards during my sophomore year in HS. Too bad I never aced math ever since. Quote Link to comment Share on other sites More sharing options...
BigNeckLawnBoy Posted January 6, 2016 Report Share Posted January 6, 2016 OH MY HEAD! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.