3 incrementing buttons, optimal value This was asked on PhysicsForums.com and I am very interested in seeing a nice solution.
Suppose we want a user to be able to enter any numeric value from 1 to 100. This number is entered by 3 buttons, each assigned a value; these buttons increment the value from 0. For example, if the user was to enter "52" and the value of the 3 buttons was (1,5,20), then the user would press 20, 20, 5, 5, 1, 1.
Since all numbers from 1 to 100 must be able to be entered, one of the buttons must be assigned "1," clearly.
The question is, what numeric value for the other two buttons will provide the least number of clicks for a value, on average?
Or equivalently, what assignment of buttons will require the least number of clicks to enter all numbers from 1 to 100 (incrementing from 0 each time, of course)?
Thanks for your input!
 A: As I was curious, I wrote a little python-script to calculate the number of clicks required for buttons $1$,$a$,$b$. Here is the plot of the result, where $x-$ and $y$-axis represent values of $a$ and $b$ respectively.

How to interpret the picture?
As a general algorithm to compute the number of clicks required to get to a fixed number $1\leq x\leq 100$, we can investigate linear combinations of $a$ and $b$: $$n\cdot a + m \cdot b,\;\; n,m\in \Bbb N_0.$$
We can calculate the least number of clicks by comparing results of $x-(na+mb)+n+m$which we may interpret as "click $n$ times $a$ and $m$ times $b$. For the remaining difference, click $1$ until we reach $x$ (note that this term is not necessarily minimized by the number $na+mb$ nearest to $x$, as $n+m$ may be too large).
So as a heuristic, it is always good to have many different values of the form $na+mb$ and only small gaps between them, as adding $1$ is expensive. 
If $a$ and $b$ have a common divisor, all numbers of the form $na+mb$ will have that divisor too. So the number of "reachable numbers" is significantly higher, if $a$ and $b$ are coprime. 
This is exactly what we can see in the picture: The "rays" of high average number of clicks represent pairs $(a,b)$ that share large divisors.
As the number of clicks does not change much if we increment $a$ or $b$ by $1$, which is satisfying as a heuristic argument, the average number of clicks is minimized for numbers which are "most coprime" in a sense that they have the highest distance to numbers sharing large divisors.
In the case of $1\leq x\leq 100$ the minimal average value of $5.21$ clicks is reached for $a=12$, $b=19$.
