The five sailors coconuts puzzle answer is 3,121 coconuts. Five sailors, one monkey, five secret night divisions, and in the morning the pile splits into five equal shares of 204, with nothing left over.
That number looks made up: not round, not small, and no amount of guessing lands on it. That is the point. The puzzle has been stumping people for a century, and the interviewer is not testing whether you can guess 3,121. They are testing whether you can find a way to work it out without grinding through five rounds of algebra.
The Question
Five sailors and a monkey are shipwrecked on a desert island. They spend the day gathering coconuts into one big pile, then go to sleep, planning to divide the pile equally in the morning.
During the night, each sailor wakes up in turn, worried the others will cheat him. Each one divides the pile into five equal parts, finds one coconut left over, gives it to the monkey, hides one fifth for himself, and puts the rest back into a pile.
All five sailors do exactly the same thing, one after another. In the morning, the sailors divide what is left into five equal shares. This time the pile divides exactly, with nothing left over.
What is the smallest number of coconuts that could have been in the original pile?
The question is a classic of puzzle collections and interview prep. Ben Ames Williams set it in The Saturday Evening Post in 1926, and Martin Gardner made it famous in Scientific American in 1958. It shows up in interview puzzle libraries, including Naukri Code 360, because it separates candidates who calculate from candidates who think.
Five Sailors Coconuts Puzzle Answer: The Chain, Step by Step
Start by checking that 3,121 actually works. Follow the pile through the night, one sailor at a time.
| Sailor | Pile when he wakes | Gives the monkey | Hides | Pile left |
|---|---|---|---|---|
| 1 | 3,121 | 1 | 624 | 2,496 |
| 2 | 2,496 | 1 | 499 | 1,996 |
| 3 | 1,996 | 1 | 399 | 1,596 |
| 4 | 1,596 | 1 | 319 | 1,276 |
| 5 | 1,276 | 1 | 255 | 1,020 |
| Morning | 1,020 | 0 | 204 each | 0 |
Every step works out whole. Sailor 1 finds 3,121, takes away 1 for the monkey, and divides the remaining 3,120 into five piles of 624. He hides one pile and leaves four piles, 2,496 coconuts. Sailor 2 finds 2,496, takes away 1, divides 2,495 into five piles of 499, hides one, and leaves 1,996. The pattern holds all the way down to the morning pile of 1,020, which splits into five shares of 204. Add it up: hidden shares 624 plus 499 plus 399 plus 319 plus 255 make 2,096, morning shares make 1,020, the monkey got 5, and 2,096 plus 1,020 plus 5 is 3,121.
Five Sailors Coconuts Puzzle Answer: The Add-Four Trick
Checking the answer is easy. Finding it is the hard part. The trick is to add four imaginary coconuts to the pile.
Suppose the pile had four extra coconuts. Then the first sailor would not need to give one to the monkey at all. The pile would divide into five equal parts straight away, he would take one part, and four fifths of the pile would remain. The same would hold for every sailor after him, because the four extra coconuts stay in the pile through every division.
Here is the key step. When a sailor takes his share, the pile, counting the four extra coconuts, shrinks to four fifths of what it was. After five sailors, the pile, still counting the four extras, is (4/5) raised to the power 5 times the starting pile, which is 1,024/3,125 times the starting pile. For that to be a whole number, the starting pile plus 4 must be a multiple of 3,125.
The smallest such pile is 3,125 minus 4, which is 3,121. The morning pile, counting the four extras, is 1,024. Take the four imaginary coconuts away, and the real morning pile is 1,020, which divides into five shares of 204. The answer falls out in four lines, with no equations to solve.
There is a neat way to check the method on a smaller case. With three sailors instead of five, the same trick says the pile plus 2 must be a multiple of 27, so the smallest pile is 25. Check it: 25 gives the monkey 1 and hides 8, leaving 16; 16 gives the monkey 1 and hides 5, leaving 10; 10 gives the monkey 1 and hides 3, leaving 6; and 6 splits into three shares of 2 in the morning. It works, and it takes ten seconds to verify by hand.
One more curiosity. A pile of minus 4 coconuts satisfies every division exactly, which is the same trick seen from the other side: each sailor gives 1 to the monkey, takes minus 1 for himself, and leaves minus 4.
The Trap Most Candidates Fall Into
The first trap is guessing a round number. People try 3,000, or 5,000, or 10,000, and test one sailor before the arithmetic breaks. The answer is oddly specific, and no round number survives five divisions that each leave exactly one coconut over.
The second trap is setting up five equations and solving them by hand. It can be done, and the answer is the same, but it takes far too long. The interviewer is watching for the candidate who stops, asks what would make every division exact, and adds the four coconuts. The puzzle rewards structure, not stamina.
The third trap is forgetting the monkey. The five coconuts the monkey receives are part of the original pile. A candidate who adds up the hidden shares and the morning shares, and gets 3,116, has lost the monkey’s five coconuts. The total check is what catches it.
The fourth trap is answering the wrong version of the puzzle. Some tellings say the morning division also leaves one coconut for the monkey. That is a different puzzle, with a different answer, and it is covered in the next section. In an interview, state the version you are solving before you start.
The Follow-Up: One More Coconut for the Monkey
Interviewers often follow up with a twist: what if the morning division also leaves one coconut for the monkey? What is the smallest pile then?
The five sailors coconuts puzzle answer for that version is 15,621. The chain runs 15,621, then 12,496, then 9,996, then 7,996, then 6,396, then 5,116. In the morning, 5,116 gives the monkey 1 and splits into five shares of 1,023.
The add-four trick explains why. This time the morning pile, counting the four extras, must also divide by 5, so the starting pile plus 4 must be a multiple of 15,625, not 3,125. The smallest pile is 15,625 minus 4, which is 15,621. The two versions differ by one small condition, and the answer jumps by more than 12,000. That is why stating the version matters.
The general rule is simple: for the exact-morning version, any pile of 3,121 plus a multiple of 15,625 works, and for the morning-leftover version, any pile of 15,621 plus a multiple of 15,625 works.
What the Interviewer Is Testing in the Five Sailors Coconuts Puzzle
This puzzle looks like an algebra question, but the algebra is the easy part. The interviewer is testing four things.
First, whether you work backwards from the end. The morning pile is the only pile you know something about: it divides by 5. A candidate who starts at the end and works back to the start has a plan. A candidate who starts with five unknown equations has a mess.
Second, whether you spot the invariant. The winning move is noticing that adding 4 coconuts makes every division exact, and that the 4 survives each step. Candidates who look for what stays the same solve hard puzzles fast. Candidates who only track what changes, grind.
Third, whether you check your own answer. The three-sailor case takes a minute to work out by hand and confirms the method before you trust it on five sailors. A good candidate runs the small case before announcing a four-digit answer.
Fourth, whether you state your assumptions. The two versions of this puzzle differ by one coconut in the morning and by 12,500 in the answer. A candidate who says which version they are solving shows the interviewer they read the question properly.
Try This Next
If you liked the backward-working trick here, try the Goldman Sachs 5 pirates puzzle next: five pirates, 100 gold coins, and a 98-0-1-0-1 split found by working backwards from the last pirate. And for another classic where the answer defies instinct, read the Monty Hall problem: switching doors wins 2 times in 3.
Sources: Ben Ames Williams, “Coconuts”, The Saturday Evening Post, 1926; Martin Gardner, Scientific American, April 1958, and The Colossal Book of Mathematics; Naukri Code 360, “Monkey and the Coconut Problem” (interview puzzle listing). The solution and all text are original.
Enjoying this? Add StudyFromNotes as a preferred source on Google to see our latest notes and updates more often:

Lauren Brooks is a finance professional who writes about the CPA and CFA exams, study strategy, and global finance careers. Lauren has sat professional finance exams and builds notes from the official syllabus and exam blueprints, with worked examples and one-page revision boxes. The beat covers US and UK exam routes, interview preparation, and the study habits that carry candidates through long exam seasons.
Leave a Reply