Problem 1
A farmer is selling apples at the market. To the first customer, he sells half of all of his apples then half of one apple. To the second customer, he sells half of all of his remaining apples then half of one apple. To the third customer, he sells half of all of his remaining apples then half of one apple etc. To the 7th customer he sells half of the apples he has left then half of one apple. The farmer has now run out of apples.
How many apples did the farmer have when he started?