The answer is a and b.
Here's the way to check:
Since all the numbers follow a constant sequence, it is possible to use division. Minus the first term, then divide it by the pattern of the sequence.
For a, 512 - 8 = 504
The pattern from a is each number is increased by 7. So,
504 ÷ 7 = 72
The number itself you count is not important. The point is that the number could be divided fully without remainder. This means 512 will appear in the sequence.
Repeat the above steps for b and c:
512 - 23 = 489
489 ÷ 3 = 163
It can be divided without remainder, 512 appears in this sequence.
512 - 12 = 500
500 ÷ 12 = 41.66666
Since C is a decimal ( there is remainder ), the number 512 does NOT appear in the sequence.
However, if you want to know the logic of WHY this works, I won't be able to give you a satisfying answer. Hope this helps you.