Chapter 30
The Coconuts and the Monkey
Five castaways spend a day gathering coconuts into one pile, meaning to share them out next morning. A monkey watches. In the night one man wakes, distrusts the others, and divides the pile into five equal heaps; one coconut is left over, which he tosses to the monkey. He hides his own heap and pushes the other four back into a pile. One by one each of the other four does exactly the same: divides into five, finds one left over for the monkey, hides a fifth, restores the rest. In the morning the pile that remains divides evenly among the five, with none left over. What is the smallest number of coconuts they could have started with?
Solution
The smallest pile is .
The clean way to see it uses a borrowed idea: a pile of coconuts. Watch what the night-time operation does to such a pile. Take away one for the monkey, leaving ; remove a fifth of that, namely , and four heaps of remain, a pile of again. So is left utterly unchanged by the whole procedure. It follows that if the real pile is such that is divisible by enough fives, the arithmetic stays whole at every step. Five nights of dividing call for five factors of five, so set Then each man in turn finds a pile one more than a multiple of five, and after all five have taken their share the morning pile is , which divides evenly by five into each. No smaller pile works.
The same trick handles the variations. For four castaways the smallest pile is ; and for the harder case of seven castaways who leave three coconuts for the monkeys at each stage, it is .