What should be a simple math question...

<p>This seems like there would be a simple yet elegant way to do this.</p>

<p>How many of the first one hundred positive integers are divisible by 3 or 4 without remainder? </p>

<p>I tried looking at how multiples of 3 and 4 repeat themselves (2, 6, 0, 4, 8, etc...) but not only did I get the wrong answer, it took forever, and didn't account well for overlaps (ex. 12 is divisible by both, which I assume the question is not looking for).</p>

<p>Anyway, thanks!</p>

<p>The highest multiple of 3 100 or below is 99. There are 99/3, or 33 multiples.
The highest multiple of 4 100 or below is 100. There are 100/4, or 25 multiples.
Total: 33+25=58.
Now, you have to count the ones that you added twice: the multiples of 12. For example, you counted 12 and 24 twice, because they are both multiples of 3 and 4.
The highest multiple of 12 100 or below is 96. There are 96/12, or 8 multiples.
So, subtract that from 58 to get 50.</p>

<p>D'oh! That makes a lot of sense and is so much quicker. I knew there was an easier way! Thanks!</p>

<p>wow dchow i never thought about it that way thanks alot!</p>