Problem statement
Five sailors were cast away in an island, inhabited only by monkeys. To provide food, they collected all the coconuts that they could find. During the night, one of the sailors woke up and decided to take his share of the coconuts. He divided them into 5 equal piles and noticed that one coconut was left over, so he threw it to the monkeys; he then hid his pile and went to sleep. A little later a second sailor awoke and had the same idea as the first one. He divided the remainder of the coconuts into 5 equal piles, discovered also that one coconut was left over, and threw it to the monkeys. He then hid his share and went back to sleep. One by one the other three sailors did the same thing, each throwing one coconuts to the money. The next morning, all sailors looking sharp and ready for breakfast, divided the remaining pile of coconuts into five equal parts, and no coconuts was left over this time. Find the smallest number of coconuts in the original pile.
My solution was, each time a sailer take his share, I recalculate the number of coconut:
$n = 5\cdot q_0 + 1 $ $\to$ # left = $\frac{4}{5}\cdot q_0 = \frac{4}{5}\cdot \frac{n - 1}{5}$
$\frac{4}{5}\cdot q_0 = 5 \cdot q_1 + 1 \to$ # left $= \frac{4}{5}\cdot q_1 ....$
Continuing this process, I ended up with a very strange fraction:
$\frac{(256\cdot n - 464981)}{1953125}$
Then I set this fraction to $5\cdot k$, since the last time # coconuts is divisible by $5$, to solve for $n$.
Am I in the right direction? Any hint would greatly appreciated.
Thanks,
Chan