I have the following snippet:
public Foo(int n) { for (int i=0; i
For a given $n$, how many "?" will be printed?
Some testing shows that the answer is $2^n$. What is the way to reach the formula?
I got to the formula $\begin{align} F(0) &= 1 \\ F(n) &= 1 + F(n-1) + \cdots + F(1) + F(0) \end{align}$ How do I simplify it to $2^n$?