There is exactly one coin hidden amongst $n$ boxes. The box it is placed in is chosen uniformly at random.
You can choose an index $i$ and the first $i$ boxes will be opened. The cost of doing this is an increasing positive function $f(x)$ . You must do this with different values $i$ until you find the coin. Clearly if $i=n$ then you find the coin immediately.
To clarify, if you choose $3$ you get to open boxes 1, 2 and 3 and it costs you $f(3)$. Having chosen 3, you must pay $f(3)$ regardless of whether boxes 1,2 have been checked already.
How can you find an optimal strategy to play this game with minimum expected cost?