I should have been more careful when stating the problem. The only type of allowed question is "is the number in S?" where S is some set of numbers.