how to solve it using bitmasking?
Not so easy math bitmasking
Hint -> Inclusion Exclusion Principle
This question if based on inclusion exclusion principle (Set theory)
let a,b,c,d,e,f… represent set of prime numbers less than 20.
Now you have to find
a union b union c union d…
this can be found by inclusion exclusion principle.
In case you need explanation do post it.
Hit like if you get it