Count the multiples of 12:
⌊1000/12⌋ = 83
(where ⌊x⌋ denotes the "floor" of x, or the largest integer that is less than or equal to x)
These are the integers
{12, 24, 36, 48, …, 996}
Count the multiples of 15:
⌊1000/15⌋ = 66
These are
{15, 30, 45, 60, …, 990}
Count the multiples of both 12 and 15; these are multiples of LCM(12, 15) = 60:
⌊1000/60⌋ = 16
These are
{60, 120, 180, 240, …, 960}
Now use the inclusion/exclusion principle to count the multiples of either 12 or 15, but not both:
83 + 66 - 2•16 = 117
Among the multiples of 12 and the multiples of 15, we count the numbers that are multiples of both 12 and 15. By subtracting the number of multiples of both (16), we get the count of integers that are either divisible by 12 or 15. We subract 16 again to remove those that are divisible by both 12 and 15.