The Monkey and the Coconuts

  1. This first problem dates from the early 20th century. Five sailors find themselves washed ashore after a shipwreck. They realize they'll need food, so they spend all day gathering coconuts. Tired, they go to sleep, agreeing to divide the coconuts in the morning.

    One sailor wakes up in the night, and since he doesn't quite trust the others, he decides to take his share. He divides the coconuts into five piles. Finding one coconut left over, he gives it to a monkey watching nearby. He then hides his pile and pushes the remaining four piles into one large pile and goes back to sleep.

    Each of the other four sailors wakes up in the night and repeats the actions of the first sailor. After dividing the pile, each finds one extra coconut, which he gives to the monkey.

    In the morning, the pile of coconuts is noticeably smaller, but since each is at fault, no one mentions it. They divide the remaining coconuts evenly among themselves.

    How many coconuts did the five men originally gather?

  2. This is my own variation on the above problem. The nighttime ritual for each of the sailors finds each taking and hiding one-fifth of the coconuts, plus one-fifth of a coconut. (Sorry, no monkeys this time.) In the morning, they again divide the pile evenly. If no coconuts are cut, how many did they originally gather?
I'd also be interested in general answers to these, with N sailors.

Source: 1. Many sources. 2. Original.


Sorin Ionescu sent this related problem:
3) We don't know the number of sailors and coconuts. The first sailor takes one coconut and one-eleventh of the rest of coconuts. The second sailor takes two coconut and one-eleventh of the rest of coconuts. The third sailor takes three coconut and one-eleventh of the rest of coconuts and so on. In the morning there were no coconuts. How many coconuts and sailors were there?

(I answered "1", and he asked for a little more interesting solution.)


Solutions were received from Bill Chapp, Sorin Ionescu, Philippe Fondanaiche, Denis Borris, Nick Baxter, Louis Elrod, Liem Nguyen, Larry Baum. One person pointed out that the solution to the first problem is already on the web. Some are at Eric's Treasure Trove of Mathematics, and Swarthmore's Forum.

The solutions are:

  1. 3121 + 15625k Coconuts
  2. 12499 + 15625m Coconuts
I found it interesting that if you set m=-1 in problem 2, you get a [negative] number remarkably similar to the minimum (k=0) number of problem 1. No one else pointed this out, so I guess it wasn't as interesting as I thought...

The general formulae are:

  1. Part 1:
  2. Part 2:
Note: N@2 means N mod 2
Mail to Ken