I would like to summarize my formula. $p$ and $y$ are constant value, $10000$ and $0.65$.
When $n = 3$, my formula recalculate the result of $n = 2$. I don't want to recalculate. Is there way to summarize or other formula for that equivalent?
$$x_n=(p+x_{n-1})y$$
Update :
For More Info :
$$\begin{align}n=1 &\Rightarrow 10000 * 0.65 = 6500\\ n=2 &\Rightarrow (10000 + 6500) * 0.65 = 10725\\ n=3 &\Rightarrow (10000 + 10725) * 0.65 = 13471.25\end{align}$$
If I put $n=7$, I don't want to recalculate the result of $n=1$ to $n=6$.
so we have like this yes
$x_n=(10000+x_{n-1})*0.65$
so we have
$x_n=6500+0.65*x_{n-1}$
rewrite it as
$x_n-0.65*x_{n-1}=6500$
http://www.economics.utoronto.ca/osborne/MathTutorialSF/FODF.HTM
see this please,important point is to see pattern,like try to use recurrent relationship like this
$y_n=3*y_{n-1}$ for example $y_{n-1}=3*y_{n-2}$ now put what is $y_{n-1}$ from the previous,it is like this