Question 278810
not quite.


there are certain numbers that are both multiples of 5 and multiples of 4 and those need to be subtracted from the total because they will be counted twice.


for example:


assume the numbers were from 1 to 100 (we can count those easier.


100 / 4 = 25
100 / 5 = 20
100 / 20 = 5


The total of numbers should be 25 + 20 - 5 = 40 numbers.


we would have:


4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100

5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100


20 is counted twice so we have to subtract 1 of them.
40 is counted twice so we have to subtract 1 of them.
60, 80, and 100 are counted twice so we have to subtract 1 of them.


the same principle applies from 1 to 1000.


number of 4's is 1000/4 = 250
number of 5's is 1000/5 = 200
number of 20's (4*5) is 1000/20 = 50
total is 250 + 200 - 50 = 400


bottom line is you have to subtract the numbers that are both divisible by 4 and 5 to avoid them from being double counted.