Problem 5 · Six pirates and 2026 coconuts
Simulating the split, rounding to the nearest integer.
Integer answer, at most 4 digitsSix pirates captured a treasure of 2026 coconuts on an island. They want to split the coconuts fairly and proceed as follows: all coconuts are placed in a pile and the pirates line up. One by one, the first pirate in line goes to the pile, divides the number of remaining coconuts by the number of remaining pirates (including himself), rounds the result up or down to the nearest integer, takes that many coconuts and sails home. Then it is the next pirate's turn, and so on. Determine how many coconuts the sixth pirate gets.
Reasoned solution
Key idea: simulate the queue. When the division lands exactly on $\tfrac{1}{2}$, the pirate (who chooses) rounds up.
$2026/6 = 337.67 \to 338$ ($1688$ left); $1688/5 = 337.6 \to 338$ ($1350$ left); $1350/4 = 337.5 \to 338$ ($1012$ left); $1012/3 = 337.33 \to 337$ ($675$ left); $675/2 = 337.5 \to 338$ ($337$ left).
Check: $338 + 338 + 338 + 337 + 338 + 337 = 2026$ ✓.