If a seller sold half the amount and $\frac12$ a unit to each customer, and ended up selling the entire stock. How many units were sold?

Proceed backward: add half a cheese and double, four times.

$$0\to1\to3\to7\to15.$$


Working forward with $x$ amount of cheese:

having served the first customer

$$\frac x2-\frac12=\frac{x-1}2$$

having served the second customer

$$\frac{x-1}4-\frac12=\frac{x-3}{4}$$

having served the third customer

$$\frac{x-3}{8}-\frac12=\frac{x-7}8$$ having served the fourth customer

$$\frac{x-7}{16}-\frac12=\frac{x-15}{16}=0.$$

From the last step:

$$x=15.$$


I would work backwards. So the last buyer bought half a cheese plus half of what was left, and that was the end of the cheeses, meaning that if $x_4$ was the amount of cheese that was left right before the fourth buyer, we have:

$$x_4-\frac{x_4}{2}-\frac{1}{2}=0$$

From this, we can quickly get that $x_4 = 1$, i.e. there was $1$ cheese left before the last buyer.

OK, so moving on to the third buyer:

$$x_3-\frac{x_3}{2}-\frac{1}{2}=x_4=1$$

meaning that $x_3=3$, i.e there were $3$ cheeses left before the third buyer bought their cheese.

...can you take the last two steps?