Problem Statement
How many integers from 1 to 1000 are multiples of 6 or 8?
Explanation
Count(6) = ⌊1000/6⌋=166; Count(8)=125; Count(LCM 24)=41. Use inclusion–exclusion: 166+125−41=250.
Hence 250 integers.
Code Solution
SolutionRead Only
166 + 125 − 41 = 250
