It's a question testing knowledge on arithmetic progression. And it's quite tricky because it's also testing knowledge on sets.
For any arithmetic progression, a1, a2, ..., an, if we know common difference d, first number a1, and last number an, we can calculate how many numbers there are in the sequence:
n=[(an-a1)/d]+1
If an integer a is divisible by 3, (a+3) is divisible by 3. In the original question, from 100-150, first number that's divisible by 3 is 102, so a1=102;
Last number divisible by 3 is 150, so an=150
Common difference d=3, so
n=[(150-102)/3]+1=17
There are 17 numbers from 100-150 that are divisible by 3.
Likewise, when a1=100, an=150, d=5,
n==[(150-100)/5]+1=11
There are 11 numbers from 100-150 that are divisible by 5.
There are 51 numbers from 100 to 150 (you can use the same formula to get 51 if you need to). So numbers that are NOT divisible by 3 OR 5 is
51-17-11=23
But here's the tricky part: there are numbers divisible by both 3 AND 5 (ie, divisible by 15), and they were deducted twice from our calculation above. Once as in set divisible by 3; once as in set divisible by 5. So we need to add the number back:
Using same formula, first number divisible by 15 is a1=105,
Last number divisible by 15 is an=150, so
n=[(150-105)/15]+1=4
23+4=27
Answer is B.
The last step can also be calculated by sets formula (refer to OG11 page 116-117). Assume that from 100-150, there are n numbers can be divisible by 3, m numbers can be divisible by 5. Total numbers should be:
|n OR m| = |n| + |m| - |n AND m|
which is
|n or m| = 17+11-4=24
Total numbers not divisible by 3 or 5 is:
51-24=27