Here is a fun problem that I am having trouble answering:
Let’s say I live in Town A, and I want to transport 249 apples across a bridge to Town B, but I can only carry 100 at a time. The bridge is 100 feet long, and I will lose one apple every foot I walk in the direction of Town B and it cannot be recovered. I will not lose apples if I walk in the direction of Town A. I am also permitted to set down apples at any point on the bridge and pick them up later. What is the minimum amount of apples I need to get 249 of them across the bridge?
Assume you have $a_k$ apples at some position $k\in\{0,\dots100\}$, say $a_k=365$. To push them forward you at least four chunks of at most hundred apples; more that four chunks will be too costly. So you move them forward for position at the cost of $4\times4$ apples.
Working back from position $100$, where we must have $a_{100}=249$ apples, we should have $a_{99}=252$ apples, $a_{96}=261$, $a_{93}=270$, that is, moving back $3$ position at the cost of $9$ each until we reach $a_k>300$, from where $4$ steps cost $16$ each and so and. If I'm not mistaken, $a_4= 650$, so $678$ apples are enough.