this is an extremely subjective question. first the nature of the pirates must be examined. if this is truly a team, then of course each pirate should receive 20 pieces of gold. however, if there is a division of labor that affords certain pirates greater responsibility then we are looking at a vertically stratified solution. in this case those at the top, the CEO's of the pirates, must be given more of the booty. if there is no stratification, but the nature of the pirates is individualistic and greedy, i would assume divide the gold into pirates 2 and 4 get 25 + you get 20 + pirates 3 and 5 each get 15.
The answer is for the first pirate to offer the 3rd and 5th pirates 1 gold each, and then take the remaining gold for himself. Otherwise the 3rd and 5th will probably not receive any gold.