Question 1119937: find the sum of all the numbers between 200 and 600 which are divisible by 16 Found 3 solutions by Theo, MathTherapy, math_helper:Answer by Theo(13342) (Show Source):
the first number between 200 and 600 that is divisible by 16 would be 208.
the last number between 200 and 60 that is divisible by 16 would be 592.
208 / 16 = 13
592 / 16 = 37
the number of numbers divisible by 16 between 200 and 600 should be 37 - 13 + 1 = 25.
doing it the hard way by counting all the numbers between 200 and 600 that are divisible by 16 and making it easier by using excel to do the manual labor, i count 25 numbers between 200 and 600 that are divisible by 16.
excel confirms the method is correct and also confirms the solution is good at 25.
here's what the first and last sections of the excel printout show.
you can see from the printouts that the first number divisible by 16 is 208 and the last number divisible by 16 is 592.
You can put this solution on YOUR website!
Backing up MathTherapy's answer, using a brute-force method:
perl -e '$sum=0; for($i=200; $i<601; $i++) { if (!($i % 16)) { $sum += $i; } }; print "sum = $sum\n"; '
sum = 10000