All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 Monkeys and Coconuts (Posted on 2003-03-26)
Five men were stuck in a desert island. The island was plentifully supplied with coconuts, fortunately, and they spent the first day gathering the coconuts, heaping them in a great pile.

That night, one of the men was sleepless at the thought that everyone would fight over the coconuts at daybreak. So he arose, crept to the pile, and counted out the coconuts. Except for one coconut, it was possible to divide the pile into five equal portions. He gave the extra coconut to the monkey (who was the only other living being on the island besides those five men), buried his share of the coconuts, then went back to a sound sleep leaving the rest again in a pile.

Then another man got up and stole to the pile with the same object in mind. Again there was one coconut left over. The second man gave the spare coconut to the monkey, buried (what he thought was) his fair share, and went back to sleep, again leaving the remaining coconuts in one pile.

One by one, the remaining men got up and did the same and everytime the monkey got his share of one coconut.

In the morning, the men divided whatever coconuts remained into five equal piles, each taking his share and saying nothing about the night just past.

What is the minimum number of coconuts the five men assembled on the first day, if in the Final Division:

(a)There was again one coconut left over and the men (as usual) gave it to the monkey.

(b) There was no coconut left over for the monkey.

 See The Solution Submitted by Ravi Raja Rating: 3.8571 (7 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
 re(5): Possible solution - smaller solution | Comment 15 of 37 |
(In reply to re(4): Possible solution - smaller solution by Charlie)

and for (b):
n = 10: tr = 6
DO
lft = n
fl = 1
FOR i = 1 TO tr - 1
lft = 4 * (lft - 1) / 5
IF lft <> INT(lft) THEN fl = 0: EXIT FOR
NEXT
IF lft / 5 <> INT(lft / 5) THEN fl = 0
IF fl THEN
lft = n
fl = 1
PRINT n
FOR i = 1 TO tr - 1
lft = 4 * (lft - 1) / 5
PRINT i, lft
NEXT
PRINT lft / 5
EXIT DO
END IF
n = n + 1
LOOP

 Posted by Charlie on 2003-03-27 09:28:47

 Search: Search body:
Forums (0)