I'd like to know the compound interest formula for the following scenario:
P = Initial Amount i = yearly interest rate A = yearly contribution or deposit added. n = the deposits will be made for 10 consecutive years. F = final amount obtained.
I start with an initial amount and an yearly interest rate applied will be applied to it. Then, every year a contribution/deposit is made at the end of the period, that is, after the interest is applied to the previous amount. No withdrawals are made.
See if this helps...
So year 1; I have my initial deposit of $P$. First I need to compute the interest gained and then I have to add the new yearly contribution $A$. So by year $1$ I have
$$F_1=P+Pi+A=P(1+i)+A$$
where $F_t$ is the total in the account after $t$ years. Now that new amount will accrue yearly interest, and then you have to add $A$ to that...
$$F_2=[P(1+i)+A]+[P(1+i)+A]i+A=[P(1+i)+A](1+i)+A$$ $$=P(1+i)^2+A(1+i)+A$$
After year 3, doing the same calculation will yield for year 3
$$F_3=P(1+i)^3+A(1+i)^2+A(1+i)+A$$
$$=P(1+i)^3+A\sum_{k=0}^2(1+i)^k$$
Note that the sum is geometric and yields the formula
$$A\sum_{k=0}^2(1+i)^k=\frac{A(1+i)^3-A}{(1+i-1)}=\frac{A(1+i)^3-A}{i}$$
Thus we can extrapolate and see that for 10 years our formula is
$$F_{10}=P(1+i)^{10}+\frac{A(1+i)^{10}-A}{i}$$ which can be reduced like @alexjo did in his using annuity formulas as
$$\left(P+\frac{A}{i}\right)(1+i)^{10}-\frac{A}{i}$$