Lamp Code: Show 22
Read the puzzle
Five lamps sit in a row. Each lamp is worth double the lamp on its right, and the rightmost lamp alone shows 1. Which row of lamps shows 22? Reading lit (1) and unlit (0) from left to right: A is 1 0 1 1 0; B is 1 1 0 1 0; C is 0 1 1 1 0; D is 1 0 1 0 1.
Which row of lamps shows 22?
Start with the biggest lamp value that fits into 22.
A
16 + 4 + 2 = 22. B is 26, C is 14, D is 21.
How to solve it
Step one: give each lamp its value. The right lamp is 1, and each lamp to the left doubles it, so from left to right the lamps are worth 16, 8, 4, 2 and 1.
Step two: build 22 greedily, starting with the biggest lamp that fits. 16 fits, leaving 22 minus 16 = 6. 8 is too big for 6, so that lamp is off. 4 fits, leaving 2. 2 fits, leaving 0. The 1 lamp is off. So the pattern is on, off, on, on, off, which is row A: 16 + 4 + 2 = 22.
Step three: check the other rows to be sure. B is 16 + 8 + 2 = 26. C is 8 + 4 + 2 = 14. D is 16 + 4 + 1 = 21.
The usual wrong answer is D, because it shares the first and third lamps with A and lands just one short at 21. Swapping the 2 lamp for the 1 lamp is an easy slip when glancing at the right end of the row. A quick check is to add the lit values out loud and confirm the total.


