Nicomachus © 1973 Ahl, David.
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 3, 5, and 7, telling him the remainder in each case. On receiving this information, he promptly discloses the number you thought of.
Published in July 1973 as a type-in program in the 101 BASIC Computer Games book.
Written by: David H. Ahl