A boat sinks in the ocean and the 5 survivors each jump into a different lifeboat. They agree to meet on the deserted island pointed out in the distance. The next morning, the first castaway walking along the beach finds a huge pile of oranges. He decides to divide them into 5 equal parts. After the division, there is one left, which he throws into the sea. He then leaves to explore the island with his share of the oranges.
The second castaway arrives at the pile of oranges, and also thinking he is the first to arrive, he decides to divide it into 5 equal parts. After the division, there is one left, which he throws into the sea, then he leaves to explore the island with his share.
same thing with the 3d,4th and 5th.
a) What is the minimum number of oranges that was on the beach initially?
I'm really strugling to find a path to the response wich is 3121, I'm trying to use mods with multiple equations but chinese rest theorem does not apply here.