This question already has an answer here:
I found a nice problem. Here is what it says:
Kevin and Peter are given a piece of paper each where they write a number.
Their friend John comes up and takes the two pieces of paper and opens them up to read the numbers on them (he reads them to himself and does not say them out loud). He then goes up to a blackboard nearby and writes down two numbers, one the sum of the numbers written by Kevin and Peter and the other, an arbitrary number.
He then asks Kevin if he knows Peter's number. After some thought, Kevin replies, "No."
Next John asks Peter if he knows Kevin's number, to which Peter, after some thought, says, "No."
John keeps asking them the same question alternatively until, at some point, one of them says that he knows the other person's number and at the same moment, the other person jumps up and says that he knows the latter's number.
How is this possible presuming that there is absolutely no cheating and we assume that Kevin and Peter are very good at math and are deep thinkers.