Answer the question
In order to leave comments, you need to log in
How many numbers less than 240 are not divisible by 2, 3, or 5?
How to solve this problem on paper?
Answer the question
In order to leave comments, you need to log in
Count those that are divisible by at least one. It should be borne in mind that some numbers will be counted several times. You need to use the inclusion-exclusion formula .
Total divisible by at least one of these numbers:
240/2 + 240/3 + 240/5 - 240/(2*3) - 240/(2*5) - 240/(3*5) + 240/(2 *3*5) = 176
So, non-fissile 240 - 176 = 64
Check:
ghci> length $ filter (\x -> 0 `notElem` [x `mod` 2, x `mod` 3, x `mod` 5]) [1..240]
64
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question