Reply
Tue 13 Oct, 2015 08:05 am

Three sailors and a monkey are shipwrecked on a desert island, where coconuts are the only available food. The men collect coconuts, but decide to wait until morning to divide the supply. However, once Bob and Carl are asleep, Mark arises, divides the pile of coconuts into three equal shares, has one left over, gives it to the monkey, hides his pile, and restacks the others. Later, Bob sneaks out of bed, divides the pile of coconuts into three equal shares, has one left over, gives it to the monkey, hides his pile, and restacks the remaining coconuts. Toward morning, Carl, too, arises, divides the pile of coconuts into three equal shares, has one left over, gives it to the monkey, hides his pile, and restacks the remaining coconuts. In the morning, the sailors meet and divide the pile of coconuts. Again, one coconut is left over for the monkey.

Find the least possible number of coconuts in the original pile, and then write a general formula for the problem (be sure to define your variables).

I know through guess-and-check that the answer is 79 coconuts, but I can't figure out the general equation.

@Emarin,

Let W be the final distribution, X be Carl's stash, Y be Bob's stash and Z by Mark's stash.

(3W + 1) = 2X

(3X + 1) = 2Y

(3Y + 1) = 2Z

(3Z + 1) = total coconuts

Substituting multiple times...

Z = (27W + 19)/8 and must be a whole number. You can do this by trial and error knowing that W must be odd or you can take it one step further by saying

27W + 19 Mod 8 = 3W + 3. The first value of W that makes 3W+3 divisible by 8 is W=7 so the answer is:

W = 7

X = 11

Y = 17

Z = 26

Total = 79