Five sailors collect a pile of coconuts; in the night each in turn divides the pile into five, gives the...
arithmetic/coconuts New
New entry, edited from material collected for the archive and not yet in a released version.
Problem
Five sailors collect a pile of coconuts; in the night each in turn divides the pile into five, gives the one left over to a monkey, and hides his share; in the morning the rest divides evenly by five. How many coconuts were there? An ocean cruiser goes down in a storm and five sailors swim day and night to an island where they collapse immediately on the beach. When they wake, they explore the island, which they find uninhabited. The only food source is on the palm trees - the coconuts. The sailors collect all coconuts on the island into a large pile on the beach and they fall asleep without eating a single one. At one o'clock in the morning the first sailor wakes and decides to count out and hide his rightful share, goes over to the coconuts, divides them into five equal piles, and finds there is one extra coconut. A small chimpanzee appears on the edge of the forest right at that moment and so the sailor tosses the extra coconut to the chimp and takes his fifth into the forest and hides them, puts the remaining coconuts back in a single pile, and goes back to sleep. At two o'clock in the morning the second sailor wakes and does the same thing, finding an extra coconut after dividing the pile into five equal piles, and again the chimp is on the edge of the forest to receive the extra coconut. The sailor hides his share, he puts the remaining coconuts back in a single pile, and goes back to sleep. At three o'clock the third sailor wakes, at four o'clock the fourth sailor wakes, each sailor finds an extra coconut when the pile is divided and each time the chimp appears and is given the extra coconut. In the morning, however, all five sailors decide to divide up the coconuts without any further ado, and this time there is no extra coconut. How many coconuts were collected? A variant: Four thieves steal a bag of nuts. They decide not to divide the nuts until morning. In the night robber No.1 gets up to take his share - he divides the pile into 4 equal parts and finds a remainder of one nut - which he gives to the parrot - he removes his share and leaves. Robbers 2, 3, and 4 follow identical procedure in sequence each dividing the ever dwindling pile into 4 with a remainder of one each time for the parrot - in the morning the balance of nuts is still divisible by 4 with one over. Smallest number of nuts to start using a one line solution? [ Editor: the first line is the editor's summary; the first version is from a posting by Braynded <Braynded@hotmail.com> in alt.brain.teasers, the variant from a mail by Aubrey <AUBREY@japhet.demon.co.uk>. ]
Show solution
[ Editor: on the five-sailor version above (four night-time
divisions, morning division exact): ]
I attempted to solve this one algebraically but ended up using trial
and error.
Let N = Number of coconuts gathered
A = Number hidden by the first sailor
B = Number hidden by the second sailor
C = Number hidden by the third sailor
D = Number hidden by the fourth sailor
E = Number received by each sailor in the morning
4 = Number received by the chimp
From the text we know:
A = (1/5)(N-1) amount remaining in the pile = (4/5)(N-1) = 4A
Chimp gets 1
B = (1/5)(4A-1) amount remaining in the pile = (4/5)(4A-1) = 4B
[Editor: was (4/5)(A-1)]
Chimp gets 1
C = (1/5)(4B-1) amount remaining in the pile = (4/5)(4B-1) = 4C
[Editor: was (4/5)(A-1)]
Chimp gets 1
D = (1/5)(4C-1) amount remaining in the pile = (4/5)(4C-1) = 4D
[Editor: was (4/5)(A-1)]
Chimp gets 1
E = (1/5)(4D) amount remaining in the pile = 0
N = 5E+D+C+B+A+4
Through algebraic substitution we get an equation of
256N = 3125E + 1476
Two unknowns with one equation
By trial and error
let's rewrite the above equations as follows
N=5A+1
A=(5/4)B+(1/4)
B=(5/4)C+(1/4)
C=(5/4)D+(1/4)
D=(5/4)E+(1/4)
E=?
Starting with : E=1, D=1.25
multiplying E by 4 : E=4, D=5, C=6.5
multiplying new E by 3 : E=12, D=15, C=19 ,B=24, A=30.25
multiplying new E by 17: E=204, D=255, C=319, B=399, A=499, N=2496
The equation 256N=3125E+1476 is a linear equation
(3125/256) is the slope of the line.
Each time E is increased by 256, N will increase by 3125
Solutions are N=2496+(x*3125) where x is any non negative integer
or N=2496, 5621, 8746, 11871, ...
The corresponding E values are: E=204+(x*256)
or E=204, 460, 716, 972, ...
-- Braynded <Braynded@hotmail.com>
[ Editor: on the four-thieves variant: ]
This was originally with five men, a pile of coconuts, and a monkey.
There are solutions every 4^5 nuts. The simplest solution is -3 nuts,
so #nuts = 4^5-3 = 1021.
1021 = 4*255+1, leaving 765.
765 = 4*191+1, leaving 573.
573 = 4*143+1, leaving 429.
429 = 4*107+1, leaving 321.
In the morning,
321 = 4*80+1, leaving 240.
-- Brian Tung <brian@cs.ucla.edu>
A little background for the puzzle...it originally appeared in 850 in
something called the Ganita-sara-sangraha [Editor: spelled
"Ganita-sangrata" in the original] by Mahavira. It then appeared in 1926
in the Saturday evening post.
The original problem used three sailors dividing the pile into three
shares each time and giving one extra to a monkey, and had a much
smaller solution.
Given s sailors, o divisions, and m coconuts given to the monkey, the
general formula is (s^o - (s-1)m). o is usually s+1, but not always.
This information comes from a book called Ancient Puzzles, by Dominic
[Editor: spelled "Domonic" in the original] Olivastro. Check it out, especially Archimedes' Cattle problem.
-- Enigma GB <enigmagb@aol.com>
Timothy F. Kingwell (quetz@futon) said:
: If anyone cares, the resulting diophantine equation is:
: 4096y - 15625x = 11529
The solution for 7 sailors is 823537, 8 is 16777209 etc.etc.
The solution for n sailors is
n to the power of n - (n-1)
This doesn't give the lowest value for small numbers of sailors.
-- Adam Buckley <ajb@oasis.icl.co.uk>