I don't have a strong math background, so I'm not sure I phrased the question well. I have a series of functions:
f(1,C,n) = C + Cn
f(2,C,n) = 2C + 3Cn + Cn^2
f(3,C,n) = 3C + 6Cn + 4Cn^2 + Cn^3
f(4,C,n) = 4C + 10Cn + 10Cn^2 + 5Cn^3 + Cn^4
f(5,C,n) = 5C + 15Cn + 20Cn^2 + 15Cn^3 + 6Cn^4 + Cn^5
f(6,C,n) = 6C + 21Cn + 35Cn^2 + 35Cn^3 + 21Cn^4 + 7Cn^5 + Cn^6
....and so on
I'm trying to determine the function for f(t,C,n) based on the above. But I don't know how to deal with the exponents, specifically that there is always some amount of Cn^(t), Cn^(t-1), Cn^(t-1) and so on...
You can easily pull out C and express a multiple of C in terms of n:
f(1,C,n) = (1 + n)C
f(2,C,n) = (2 + 3n + n^2)C
f(3,C,n) = (3 + 6n + 4n^2 + n^3)C
f(4,C,n) = (4 + 10n + 10n^2 + 5n^3 + n^4)C
f(5,C,n) = (5 + 15n + 20n^2 + 15n^3 + 6n^4 + n^5)C
f(6,C,n) = (6 + 21n + 35n^2 + 35n^3 + 21n^4 + 7n^5 + n^6)C
But I'm not sure if that helps... So I'm curious about:
1) A specific answer to "what would f(t,C,n) look like?"
AND/OR
2) Is there a general rule or method that would help me solve this? What do you when a series starts to look like:
x|f(x)
1|n
2|n + n^2
3|n + n^2 + n^3
4|...
In response to @david-k 's answer, I generated the functions as follows:
They are meant to represent investing an annual contribution (C) into an investment with an annual return (n) for a given number of years (t). (I know there are existing tools to calculate this, but I wanted to understand how to get there.) f(t,C,n) is total the amount you would have after t years.
So I started with a base case of 1 year. After a year, you'd have the money you put in (C) and the interest on that money (Cn). So
f(1) = C + Cn
or
f(1) = (1 + n)C
After the next term, you have what ever you had after the first term (C+Cn) plus an additional C (the new money you added) plus all of that times the return (n).
f(2) = (C + Cn + C) + (C + Cn + C)n
= 2C + Cn + (2C + Cn)n
= 2C + Cn + 2Cn + Cn^2
= 2C + 3Cn + Cn^2
= (2 + 3n + n^2)C
So each f(t) was figured out by taking the function for f(t-1), adding C to it, then adding all of that (f(t-1)+C) multiplied by n. (Which is the same as saying that f(t) = (f(t-1)+C) * (1 + n) but I didn't see that until later.)
Factoring out $C$ makes a lot of sense. It actually does help with the next step of simplification.
The function values seem to follow a certain pattern involving binomial coefficients (numbers from Pascal's triangle). These same kind of numbers show up in the expansion of expressions such as $(1+n)^k$:
\begin{align} (1+n)^2&=1+2n+n^2,\\ (1+n)^3&=1+3n+3n^2+n^3,\\ (1+n)^4&=1+4n+6n^2+4n^3+n^4,\\ (1+n)^5&=1+5n+10n^2+10n^3+5n^4+n^5,\\ (1+n)^6&=1+6n+15n^2+20n^3+15n^4+6n^5+n^6,\\ (1+n)^7&=1+7n+21n^2+35n^3+35n^4+21n^5+7n^6+n^7. \end{align}
Notice how similar these are to your formulas. In fact, the only things we need to do to make them match exactly are to subtract $1,$ reduce the number in the next term by $1$ (for example $6n$ instead of $7n$), and reduce each power of $n$ by $1.$ That is, $$ f(k,C,n) = \frac{(1+n)^{k+1} - n -1}{n}C. $$
Update: The information added to the question makes it possible to state the answer more definitely.
We can see that the proposed formula for $f(k,C,n)$ works for the first few iterations of your process. Now suppose after $k$ years the balance of the account is $\frac{(1+n)^{k+1} - n -1}{n}C$ as predicted by the proposed formula. Add the new investment, $C,$ and accrue interest for one more year, multiplying by $1+n,$ and the new balance is $$ \left(\frac{(1+n)^{k+1} - n -1}{n}C + C\right)(1+n), $$ which is equal to $$ \frac{(1+n)^{k+2} - n -1}{n}C, $$ as predicted. So the formula is also correct for $k+1$ years. By mathematical induction, The formula is good for any positive integer $k.$