You need to make a set of five rods for a magic trick, with numbers on them ranging from 1 to 31 inclusive. Then you ask people to pick a number and show you

**only the top number** of whatever rods it is on. From that you have to guess which number the person picked. This has to be done within a few seconds and isn't a matter of remembering what numbers are on them.

What numbers should be on each of the five rods?

(In reply to

Full Solution by SilverKnight)

Further explanation, if that wasn't clear... take 26 (for example)...

26 written in base 2 is:

11010 (16 + 8 + 2), and it is on Rods 2, 4, and 5, corresponding to those bits.

And to solve the "missing number", you simply add up the first number in the list... (the person tells you it's on the rod starting with 2, with 8, and with 16, and you simply **add those numbers together**!).

Hope that's clear.

*Edited on ***November 11, 2003, 1:49 pm**