Three sailors and one monkey are on an island. During the day they collect a heap of coconutsand decide to share it the following morning. In the night, the first sailor awakes and decides to takes his share. He divides the heap into three equal parts, but one nut remains, which he gives the monkey. He takes his third, hides it, and goes to sleep. A little later, the second sailor awakes, does the same, and a little later the third as well. In the morning they divide the remaining heap again into three parts, and again one nut remains, which they give to the monkey. How many coconuts did they have at the beginning?
Solve this problem, and explain the method used.
Erich Prisner, September 2003