We use cookies to personalise content and advertisements and to analyse access to our website. Furthermore, our partners for online advertising receive pseudonymised information about your use of our website. cookie policy and privacy policy.

Several men (x of them) crash-land their airplane on a deserted island in the South Pacific. On their first day they gather as many coconuts as they can find into one big pile. They decide that, since it is getting dark, they will wait until the next day to divide the coconuts. By lot they chose 5 among them to watch for rescue searchers while the others slept. The first watcher got bored so he decided to divide the coconuts into x equal piles. When he did this, he found he had one remaining coconut. He gave this coconut to a monkey, took one of the piles, and hid it for himself. Then he jumbled up the (x-1) other piles into one big pile again. To cut a long story short, each of the five men ended up doing exactly the same thing. They each divided the coconuts into x equal piles and had one extra coconut left over, which they gave to the monkey. They each took one of the x piles and hid those coconuts. They each came back and jumbled up the remaining (x-1) piles into one big pile.


What is a formula to devise the smallest amount of coconuts for x amount of men

Examples of amounts: 

For 6 men, the smallest number of coconuts is 7771

For 12 men, the smallest number of coconuts is 248821

For 44 men, the smallest number of coconuts is 164916181

For 7 men, the smallest number of coconuts is 16801

For 20 men, the smallest number of coconuts is 3199981

 Nov 10, 2019

I have a solution to this that is very involved. But I will try to outline it even though it may not be the most elegant solution. Here it goes:

Here I assume that x is the number of people stranded on the island, n is the number of coconuts gathered and piled before dark, and k1, k2, k3, k4, and k5 are the number of coconuts, respectively, in each of the x piles after the additional coconut is given to the monkey and before the night watches 1 through 5 hide their own portion. We can write a system of 5 equations involving the 7 variables(n, x,  k1, k2, k3, k4, and k5) as follows:

\(k_1x= n -1\)

\(k_2x=n-k_1-2 \)





This system evidently has an infinite number of solution since the number of variables is larger than the number of equations and can be approached in multiple ways, but all methods would involve a reduction of the number of variables. Here we are asked to find the minimum value of n for a given value of x, so we will reduce the number of equations to only one, a quintic polynomial equation in the variable x, the number of stranded people, and containing two other variables, n and k5. I will only do step one of this process since the rest can be accomplished similarly.

Multiply the 5th equation by x to get:


Replace k1x, k2x, k3x, and k4x by their values given by the 1st through 4th equation in the system to get :



Note that k4 has been eliminated from the equation and by repeating this process 3 more times , we can also eliminate k1, k2, and k3 to get the quintic we were aiming at:




Moving all terms to the left side we get:




Well this is the formula we were looking for. The author of this question claims that if the there are only six people stranded on the island, the initial number of coconuts would have to be a minimum of 7,771. Let's see if this holds true. Substituting 6 for x in the above equation we get:


\(7,776k_5+4,651-625n\), which implies that


\(n=\frac{7,776k_5+4,651} {625}\)


Here we need to find the smallest value of k5 that results in an integer value for n. I gave the problem to EXCEL to solve. EXCEL did a search for k5=1, 2, ..., 10,000, we decided to limit the search, and came up with 16 values for k5 that resulted in integer values for n.The smallest of these values was k5=624 and the largest was k5=9,999. Plugging these for k5 in the formula for n, gave us, what do you know, n= 7,771 and n= 124,411.

 Nov 11, 2019

1 Online Users