One of the most ancient forms of mathematical puzzle is sometimes referred to as a “boomerang.” At some time, everyone has been asked to “think of a number,” and, after going through some process of private calculation, to state the result, after which the questioner promptly tells you the number you originally thought of. There are hundres of varieties of the puzzle.
The oldest recorded example appears to be that given in Arithmetica of Nicomachus who died about the year 120. He tells you to think of any whole number between 1 and 100 and divide it successively by 2, 5, and 7 telling him the remainder in each case. On receiving this information he promptly discloses the number you thought of.
Can you discover a simple method of mentally performing this feat? If not, you can see how the ancient mathematician did it by looking at the source code.
Nicomachus was written by Joe Larson based on a BASIC program by David H Ahl as found in ‘BASIC Computer Games’ edited by David H Ahl (c) 1978.

Download and Play
Download the source code