# Distinguish between 7, 13, 17, 19 with one question (answer 0, 1, 2, or 3) [closed]

I am thinking of a prime number, either 7 or 13 or 17 or 19.

You can ask me only one question to which the answer I give must be either 0 or 1 or 2 or 3. Can you then tell what number I am thinking?

Conditions: Please don't ask a question on the progression order of the numbers like "If you consider 23 as the 4th number in a progression of Prime numbers, and discard 11, what progression number will you get". In this case 19 would be 3rd, 17 would be 2nd etc. Also you cannot assign values to the 4 numbers. For example "If 7 is 0, 13 is 1, 17 is 2 etc" - that will be too simple.

• Why can't I just use a polynomial from Lagrange interpolation? Aug 21, 2017 at 21:27
• Possible duplicate of Differentiate between the numbers from 1 to 5 with one single yes/no question (not exactly the same question, but that one should answer this - you've got one question with multiple possible answers in order to distinguish between at least 4 different numbers). Aug 21, 2017 at 23:41

Take your number modulo 8, subtract 1 and divide by 2. 0 -> 17, 1-> 19, 2-> 13, 3-> 7.

• That is the exact solution I thought of! Two hours late of course... Aug 21, 2017 at 18:20

Here is my question:

How many zeros (excluding leading) are in the base 2 representation of your number? 7->111, zero 0's. 13->1101, one 0. 17->10001, three 0's. 19->10011, two 0's.