Artificial intelligent assistant

A ruler with missing graduation. > What is the minimum number of graduations, i.e. $f(n)$, on a ruler such that it can measure all integral units from $1$ to $n$, which $n\in\mathbb{Z}$, inclusively? For example, to measure from $1$ to $5$ units, you only need $4$ graduations (not $6$) as shown in this figure: !enter image description here So, how can we deduce a general way general way to find $f(x)$. I suspect this has something to do with combination, which is not something I'm familiar with. Can anyone give me a hand? Thank you.

These things have been studied, and the appropriate search terms for Googling are _sparse rulers_ , _complete rulers_ , _optimal rulers_ , and _perfect rulers_ , but as far as I know there is no known simple solution which works for all lengths $n$.

The wikipedia article on Sparse Rulers gives many examples and a number of references where you can find out what has already done on this problem.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy df27192cd8ccea58784da22235b4e201