On the third day, he ate the remaining half and added another one. The remaining one was the same as the food before he ate that one. He ate another one, and there was one left, so on the third day, half of the apples were two, a total of four.
Similarly, the next day is (4+ 1)×2= 10.
On the first day, this pile of apples is (10+ 1)×2=22.