# Pirates Dividing Loot Question- NEW

This is a long question so bear with me.

Four pirates find a treasure consisting of gold coins on a tiny island. They gather all the coins in a pile under a palm tree. Exhausted, they agree to wait until morning to split the coins.

At 1 in the morning, the 1st pirate wakes. He realizes the others cant be trusted, and decides to take his share now. He divides the coins into four equal piles, but there is one left over. He throws the extra one in the ocean, hides his coins, and put the rest back undr the palm tree.

At 2, Pirate 2 wakes up. Not realizing pirate 1 has already taken his share, he also divides up the remaining coins into 4 piles, with 1 left over. He throws the extra one in the ocean, hides his share and pus the rest of the coins back under the tree.

At 3 and 4 in the morning, the third and fourth pirates each wake up and carrry out the same actions.

In the morning, the pirates wake up, trying to look innocent. Noone says anything about the diminished coin pile. They divide the remaining pile into four piles for the fifth time, but this time there is no coin left over to throw in the ocean.

Find the smallest number of coins in the original pile.

I cant get this, my math teacher gave it to us. If you find the answer let me know, but if you have a method to this besides guess and check i'd like to know how.

Related General Discussion News on Phys.org
This was more tedious than it sounded.

I get an equation that says

$$T = \frac{4}{3} \left( \frac{4}{3} \left[ \frac{4}{3} \left( 16P+1 \right) +1 \right] +1 \right) +1$$

T = total coins. P = how much each pirate gets at the division in the morning.

Expanding, and barring errors.

$$27T = 1024P + 148 +27$$

At a guess, the answer might be the smallest positive P such that T is an integer.

Edit: This seems to work, oddly enough.

Last edited:
Thanks alot man, just to make sure i worked it out right, did you get 765

Thanks alot man, just to make sure i worked it out right, did you get 765
yes. In the last step I needed to find integer solutions for 27A = 1024B - 14. Is there an easier way to do this than making 27(?) tests?

i dont know if there is an easier way, i'd like to know too. i used the equation you gave me
27t=1024p+175, started from zero and increased p which finally gave me a whole number when i got to 20.

CEL
yes. In the last step I needed to find integer solutions for 27A = 1024B - 14. Is there an easier way to do this than making 27(?) tests?
Yes, this is a Diophantine equation. See http://en.wikipedia.org/wiki/Diophantine_equation for an explanation.
You have
A = 1024B/27 - 14/27 = 37B + (25B - 14)/27
Since A and B are integers, (25B - 14)/27 must be an integer too.
(25B - 14)/27 = C
25B - 14 = 27C
25B = 27C + 14
B = 27C/25 - 14/25 = C + (2C + 14)/25
Now, you make
2C + 14 = 25D
2C = 25D - 14
C = 12D + D/2 - 7
D/2 must be an integer
D/2 = 1 is the minimum integer
Now you have D = 2
Working backwards I got A = 758 and not 765. This is not the right answer, because 758/4 gives a remainder of 2, not 1.

Working with the equation
27T = 1024P + 175
I got the good answer: T = 765.

Working backwards I got A = 758 and not 765. This is not the right answer, because 758/4 gives a remainder of 2, not 1.
No, that wasn't it. I defined A = t - (175 mod 27) + 1 to simplify calculator punching, or so I'd thought, thus the difference of 7.

Cool algorithm, by the way;

For

$$\Phi_1 A = \Phi_2 B + \Gamma$$

each step in the algorithm takes

$$\Phi_{large}, \Phi_{small}$$

to

$$Rem(\Phi_{large} / \Phi_{small} ), \Phi_{small}$$

in alternating fashion.

Last edited: