I just did this little math puzzle for an assignment in my discreet structures class and I thought I'd share it with you guys, let's see who can get the correct answer first.
The story goes like this: There are five pirates partying over a chest of diamonds they've just plundered which they're planning on splitting up in the morning before they go their separate ways. During the night one of the pirates wakes up and decides to go ahead and take his share so he can set sail early, so he splits the diamonds equally into five piles. At the end of the five piles he ends up with one extra diamond, so he thinks about it for awhile and decides to throw it in the ocean, take his pile, pool the rest of the diamonds back into the chest, and take off with his share.
A few minutes later, another pirate wakes up and does the exact same thing, not noticing that the first pirate had already taken his share, thus making five piles again. At the end, he too ends up with one extra diamond and decides to toss it into the ocean. After taking one of the piles and pooling the rest back into the chest, he sets sail as well.
This goes on one by one until all five pirates have eventually left, never noticing that the others left before them, and each time there is one extra diamond.
The question is: what is the least possible number of diamonds that could have possibly originally been in the chest? GOOD LUCK