A monkey has a sack full of peanuts. Every morning his master puts exactly one hundred peanuts in his bag. During the day, the monkey eats half of the peanuts it finds in the sack and leaves the other half. Since he does not like to eat half-peanuts, when the number of peanuts in the bag is odd, leave one more in the bag.

One night, after several years behaving like this, the monkey master was curious and counted the number of peanuts that the monkey had saved in his bag just before adding the ration of the day.

**Do you know how many peanuts were in the sack?**

#### Solution

The number of peanuts he had at the beginning is irrelevant since the more peanuts he has the more he eats. This causes that over time the amount of peanuts in the bag tends to stabilize at a fixed value: (x + 100) / 2 = x. **There were 100 peanuts in the sack**.