Hello, mathcalculushelp!

This is a classic problem, usually called "The Monkey and the Coconuts";

. . often there are five or more sailors.

Let = the original number of bananas.

The first sailor divided them into 3 equal groups and had 1 banana left over.

. . . .[1]

He hid bananas and put the remaining bananas back in a pile.

The second sailor divided the bananas into 3 groups and had one left over.

. . . .[2]

He hid bananas and put the remaining bananas back in a pile.

The third sailor divided the bananas into 3 groups and one left over.

. . . .[3]

He hid bananas and put the remaining bananas back in a pile.

In the morning, they divided the bananas into 3 groups and had one left over.

. . . .[4]

From [4], we have: .

Substitute into [3]: .

Substitute into [2]: .

Substitute into [1]: .

So we have: .

Since is an integer, must be divisible by 8.

The first time this happens is when

Therefore: .