===== Answer ===== 3121 Solution: (adapted from [[http://www.puzzle.dse.nl/teasers/index_us.html#coconut_chaos|THE ULTIMATE PUZZLE SITE]]) Each pirate leaves //4/5(n-1)// coins of a pile of //n// coins. This results in an awful formula for the complete process (because every time one coin must be taken away to make the pile divisible by 5): //4/5(4/5(4/5(4/5(4/5(p-1)-1)-1)-1)-1)//, where //p// is the integer number of coins in the original pile. The trick is to make the number of coins in the pile divisible by 5, by adding 4 coins. This is possible because you can take away those 4 coins again after taking away one fifth part of the pile: normally, //4/5(n-1)// coins are left of a pile of //n// coins; now //4/5(n+4)=4/5(n-1)+4// coins are left of a pile of //n+4// coins. Because of this, the number of coins in the pile stays divisible by 5 during the whole process. So we are now looking for a //p// for which the following holds: //4/5×4/5×4/5×4/5×4/5×(p+4)=(45/55)×(p+4)//, where p is the number of coins in the original pile. The smallest //(p+4)// for which the above holds, is //55//. So there were //p=56-4=3121// coins in the original pile.