1,260 views
0 votes
0 votes

The sum of all integers from 1 to 1000 that are divisible by 2 or 5 but not divisible by 4 equals 
 

  1. 175000
  2. 225500
  3. 149500
  4. 124000

1 Answer

Best answer
4 votes
4 votes

numbers divisible by 2=1000/2=>500

numbers divisible by 5=1000/5=>200

but numbers like 10,20,30...are divisible by both 2 & 5 so they will be counted twice so we need to subtract them..to get the numbers that are only divisible by 5

that is multiples of 10

numbers divisible by  10=1000/10=>100

numbers divisible by 4=1000/4=>250 

sum=(2+4+6.....+1000) + (5+10+15....+1000) - (10+20+30....+1000) - (4+8+12....+1000)

sum= 2(1+2+3....500) + 5 (1+2+3...200.) - 10(1+2+3...100) - 4(1+2+3....250)

sum = 2*(500)*(501)/2 + 5 *200*201/2 -10*100*101/2 -4  *250*251/2

sum = 250500 + 100500 - 50500 -  125500

sum= 175000

selected by

Related questions

1 votes
1 votes
0 answers
3
Sahil Gupta asked Nov 25, 2014
777 views
Answer the following part:a) Show that, under the assumption that the input is equally likely to be any of the n! permutations of theseintegers, the average number of com...