This puzzle comes from Alex Bellos’ column in the Guardian. It has been adapted from one by Prem Prakash, an electrical engineer from Bangalore, India, who has taken early retirement to develop puzzle-based teaching workshops.
You and your two friends Pip and Blossom are captured by an evil gang of logicians. In order to gain your freedom, the gang’s chief, Kurt, sets you this fearsome challenge.
The three of you are put in adjacent cells. In each cell is a quantity of apples. Each of you can count the number of apples in your own cell, but not in anyone else’s. You are told that each cell has at least one apple, and at most nine apples, and no two cells have the same number of apples.
The rules of the challenge are as follows: The three of you will ask Kurt a single question each, which he will answer truthfully ‘Yes’ or ‘No’. Every one hears the questions and the answers. He will free you only if one of you tells him the total number of apples in all the cells.
Pip: Is the total an even number?
Kurt: No.
Blossom: Is the total a prime number?
Kurt: No
You have five apples in your cell. What question will you ask?
See here for the solution.