I am trying to find $f_n$ from $f_{n-1}$, where $f_n$ is the sum of all combinations of length $n$ from a set. As an example, let the set be $\{a_1, a_2, a_3, a_4, ... a_k\}$.
$f_0$ by default is $1$. $f_1 = a_1+a_2+a_3 + ... a_k = \sum_{i=1}^{k} a_i$.
$$f_2 = a_1a_2+a_1a_3+...a_1a_k+a_2a_3+...a_k... = \sum_{i=1}^k\sum_{j = i+1}^k a_ia_j$$
In general, $$f_n = \sum_{i=1}^{k}\sum_{j=i+1}^k\sum_{l=j+1}^k... \sum a_ia_ja_l...$$ where there are $n$ sums and the product is $n$ elements with the given indices.
What I am trying to do is find $f_2$ based off $f_1$ and $f_0$, and $f_3$ from $f_2, f_1, f_0$. The only outside information can be $g_n = \sum_{i=1}^k a_i^n$ (i.e. the sum of all elements in the set raised to the $n$th power).
I found that $$f_1 = g_1$$ $$f_2 = \frac{f_1^2-g_2}{2}$$ $$f_3 = \frac{3f_1f_2-f_1^3 + g_3}{3}$$
I wasn't able to find a general formula for this, or even $f_4$.
How can I find a general formula for $f_n$?