Task B-1.5. On an island, five people and a monkey live. One day, they all gathered coconuts and put them in a common pile. They agreed to divide the coconuts among themselves the next day. During the night, one of the five islanders took their share. She divided the coconuts into 5 equal piles and had one coconut left over. She gave that one to the monkey, hid her pile, and combined the remaining four piles back into one large pile. The other four islanders did the same, one after another, each giving one coconut to the monkey so that the piles could be evenly divided. What is the smallest possible number of coconuts in the original pile?
## First Solution.

After subtracting 1 from the number of walnuts in the initial pile, we must get a number divisible by 5. This means the initial number is from the set $6,11,16,21,26, \ldots$. After subtracting 1, we multiply by

$\mathrm{S} \frac{4}{5}$ because the first person kept $\frac{1}{5}$ for themselves, leaving $4,8,12,16$, $20, \ldots$ for the second person to distribute.

Since the second person continues the process, when we subtract 1 from these numbers and multiply by $\frac{4}{5}$, the result must be an integer. This means the only possible numbers (of walnuts in the pile after the first person) are $16,36,56,76,96, \ldots$.

Similarly, we conclude further:

If we subtract 1 from the previous numbers and multiply by $\frac{4}{5}$, we get the numbers $12,28,44$, $60,76, \ldots$,

However, for the third person to continue the process, only the numbers $76,156,236,316,396, \ldots$ remain after the second person.

After subtracting 1 and multiplying by $\frac{4}{5}$, we get $60,124,188,252,316, \ldots$, but for the fourth person to be able to distribute after the third person, only the numbers 316, 636, 956, 1276, $1596, \ldots$ remain.

After the fourth person, the remaining numbers are 252, 508, 764, 1020, 1276, ..., and the smallest possible number is 1276.

After the fifth person, 1020 walnuts remain on the pile, so the fifth person received $\frac{1276-1}{5}=255$ walnuts.

Now that we have found the smallest (integer) number of walnuts that remain after all distributions, let's work backwards.

Before the fifth person, there were 1276 walnuts on the pile.

Before the fourth person, there were $\frac{5}{4} \cdot 1276+1=1596$ walnuts. We calculate similarly further.

Before the third person, there were $\frac{5}{4} \cdot 1596+1=1996$ walnuts.

Before the second person, there were $\frac{5}{4} \cdot 1996+1=2496$.

And finally, before the first person, there were $\frac{5}{4} \cdot 2496+1=3121$ walnuts.