Solution
Threes and Fives
Show the problem again
How many integers from 1 to 1000 are divisible by 3 or 5 (or both)?
Worked solution
The answer is 467. By inclusion-exclusion: ⌊1000/3⌋ + ⌊1000/5⌋ − ⌊1000/15⌋ = 333 + 200 − 66 = 467. Subtracting the multiples of 15 corrects for counting them twice.
Source: Standard inclusion-exclusion exercise; the same form opens Project Euler as Problem 1. Statement written for AxiomIQ.