You invest $50 each month in a retirement account, starting at age 20. You invest $50 each month in a retirement account, starting at age 20. Assume the value increases at an average of 6% per year, compounded monthly, and you never make a withdrawal.


*

*Calculate the value of your retirement account if you retire at age 65.

*How much money do you need to invest each month if your goal is to have a million dollars when you turn 65, if you start saving for retire when you are: i) 20 years old;       ii) 30 years old


This is my mathematical model: x(n+1) = x(n) + (0.06/12)(50) where x0=50 and xn=amount of money in the account per month
For part 1, if I retire at age 65 that would be 45 years. Thus, I would just need to do my mathematical model formula 45 times since  nothing else is changing except the number of years right?
For part 2i and 2ii, I do not understand where to put the 1,000,000 dollars in my math model. The only place, I think it would go is in the position where x(n+1) would be...
Edit: I am not supposed to be using formulas already known for compound interest, etc.
 A: You can use the formula 
$$FV = PV\left(1 + \frac{r}{m}\right)^{mt}$$
where 
\begin{align*}
PV &= \ \ \text{Money you invest today}\\
r &=  \ \ \text{Interest rate}\\
t &= \ \ \text{Number of years}\\
m &= \ \ \text{Number of periods based on compound frequency}
\end{align*}
To answer both question this formula is all you need. Can you solve from here?
A: Your model is not correct, because it only accounts for the accrued interest, not the regular payments of $50$ each month.  Instead, if $x_n$ is the amount in the retirement fund at the beginning of month $n+1$, you should have 
$$\begin{align*}
x_0 &= 50, \\ 
x_{n+1} &= 50 + \left( 1 + \frac{0.06}{12} \right) x_n, \end{align*}$$
Note I have assumed that contributions are made at the beginning of each calendar month, and that the amount accrued is calculated right after the contribution.  If you want the value of the fund just prior to the next month's contribution, you simply subtract $50$.
If we rewrite this recurrence as $$x_{n+1} = 50 + 1.005x_n,$$ then we can see one way to solve it is to find a constant $c$ such that $$x_{n+1} + c = 1.005(x_n + c).$$  This then requires $$1.005c = 50 + c,$$ or $$c = 10000.$$  Therefore, if we let $$y_n = x_n + 10000,$$ we get the simpler recurrence $$y_{n+1} = 1.005 y_n,$$ which forms a geometric sequence with common ratio $r = 1.005$.  The solution to this recurrence is $$y_n = (1.005)^{n-1} y_0,$$ and with the initial condition $$y_0 = x_0 + 10000 = 10050,$$ we get $$x_n = (10050)(1.005)^{n-1} - 10000.$$  As there are $n = (65 - 20)(12) = 540$ payments from age $20$ to age $65$, not counting the payment that would occur upon turning $65$, the accumulated value is $x_{540} - 50 = 137750$.
The answer to the second part is simple; you would go through the steps I outlined above, except changing $50$ to some variable, say $K$.  Then in the case where you start contributing to the fund at age $20$, we still have the same $n = 540$, and you solve the equation for $K$ such that $x_{540} - K = 10^6$, and for the case where contributions begin at age $30$, you adjust $n$ accordingly.  I have left this as an exercise for the reader.
