Imagine you have $n$ coins. Coin $i$ has a probability $p_i$ to get heads. You can choose these probabilities so long as $\sum_{i=1}^n p_i = \alpha$ for some constant $\alpha \leq n$. Now that you've chosen the probabilities, you must play a game. Flip coin 1; if it comes up tails, you must restart the game. However, if it comes up heads, flip coin 2; if it comes up tails, you must restart the game. To win the game you must flip $n$ heads in a row. You want to assign the probabilities $p_i$ such that the expected number of coin flips is minimized.
Note that if the question were to assign $p_i$ such that the probability of winning is maximized, a standard result is to choose $p_i = \frac{\alpha}{n}$ for all $i$.
Formally, this problem can be stated as:
$$\min_{p_i} E_n \text{ where } E_n = \left(n \prod_{i=1}^n p_i + \sum_{i=1}^n (E_n + i) \ p_1 p_2 \ldots p_{i-1} (1 - p_i)\right)$$
With the following constraints:
$$\sum_{i=1}^n p_i = \alpha \text{ and } p_i \in [0, 1]$$
In the case of $n=2$ this is easy, we have $p_2 = \alpha - p_1$ and:
$$E_2 = 2 p_1 (\alpha - p_1) + (E_2 + 1)(1 - p_1) + (E_2 + 2)p_1(1 - \alpha + p_1)$$
Solving for $E_2$ and setting $\frac{\partial E_2}{\partial p_1} = 0$, we eventually find:
$$p_1 = \sqrt{1 + \alpha} - 1$$
For $\alpha = 1$, this gives $p_1 \approx 0.414$. This agrees with intuition - instead of doling out the probabilities equally, you should favor lower probabilities for low indices $i$ and higher probabilities for high indices $i$. When $\alpha \geq 2$, we would expect the formula to return $p_1 \geq 1$, since $p_1 = p_2 = 1$ is optimal, but for some reason it does not do this.
However, it already becomes very difficult when $n=3$. Is there a general way to attack this problem?
I'm able to derive the following:
$$E_n = \frac{1 + p_1 + p_1 p_2 + \ldots + p_1 p_2 \cdots p_{n-1}}{p_1 p_2 \cdots p_n}$$
Using the method of Lagrange multipliters, I can get the following $n+1$ nonlinear equations in $n+1$ variables:
$$\frac{\partial E_n}{\partial p_i} = -\frac{1 + p_1 + p_1 p_2 + \ldots + p_1 p_2 \cdots p_{i-1}}{p_1 p_2 \cdots p_{i-1} p_i^2 p_{i+1} \cdots p_n} + \lambda = 0$$
$$\frac{\partial E_n}{\partial \lambda} = p_1 + p_2 + \ldots + p_n - \alpha = 0$$
But I don't see how to solve this set of nonlinear equations.