According to the book,The theory of interest,
at page 158, I found this formula:
$$B_{t+1}=B_t\cdot (1+i)-R,$$
while $B_t$ means the outstanding balance at time $t$ and $R$ means the installment payment at the end of each period.
I don't get why this formula is established......
Let's say you take out a loan of $B_0$ at $t=0$ (present) and you repay a constant installment $R$ every year. And let denote the yearly nominal interest rate as $i$. On one hand in one year the outstanding loan increase by $B_0\cdot i$. Consequently the loan increase to $B_0+B_0\cdot i= (1+i)\cdot B_0$. On the other hand you repay the installment R (at the end of the year).
Thus the outstanding loan at $t=1$ is $B_1=(1+i)\cdot B_0-R$. The recurrence equation can be written for $t=2, t=3, ...$
$B_1=(1+i)\cdot B_0-R \quad (1)$
$B_2=(1+i)\cdot B_1-R \quad (2)$
$B_3=(1+i)\cdot B_2-R \quad (3)$
$\vdots$
You can use the term for $B_1$ from the first equation and insert it in the second equation.
$B_2=(1+i)\cdot ((1+i)\cdot B_0-R)-R=B_0\cdot (1+i)^2-R\cdot (1+i)-R$
Next use the term for $B_2$ from the second equation and insert it in the third equation.
$B_3=(1+i)\cdot (B_0\cdot (1+i)^2-R\cdot (1+i)-R)-R$
$=B_0\cdot (1+i)^3-R\cdot (1+i)^2-R\cdot (1+i)-R =B_0\cdot (1+i)^3-R\cdot \left(1+(1+i)+(1+i)^2 \right)$
A pattern can be observed and we can generalize it to an arbitrary year $t$.
$B_t=B_0\cdot (1+i)^t-R\cdot \left(\color{blue}{1+(1+i)+(1+i)^2+\ldots +(1+i)^{t-1}} \right)$
The blue term is a finite $\textrm{geometric series}$ [1] which has a closed form: $\sum\limits_{i=0}^{t-1} x^i=\frac{x^t-1}{x-1}$. Thus $B_t$ can be simplified to
$$B_t=B_0\cdot (1+i)^k-R\cdot \frac{(1+i)^t-1}{(1+i)-1}=B_0\cdot (1+i)^t-R\cdot \frac{(1+i)^t-1}{i}$$
I hope I was able to clarify some questions. If something is unclear, feel free to ask.