# Calculating the amount we shorten the repayment time of a loan by readjusting installments

Assuming we can afford to pay 1000 E/month and we subscribe to a 20-year mortgage plan at 5% annual rate. I first want to know what the maximal mortgage can be.
I have the following formula:
$C=\cfrac{P}{\cfrac{1-(1+r/12)^{-n}}{r/12}}$,
where $n$ is the number of monthly instalments of $C$ euros we have to pay in order to pay off our loan of $P$ euros with $r$ the annual interest rate.
I know that $n=20*12=240$ months, $r=0.05$ and $C=1000$ thus I calculate the maximal mortgage ($P$) using the formula this gives $P=151525$.
Know assume that after 5 years we readjust the installments to 1200 E/month. I want to know how much this shortens the repayment time. Again I have a formula that calculates the amount we have to pay after k payments:
$P\cfrac{(1+r/12)^{n}-(1+r/12)^{k}}{(1+r/12)^{12}-1}$
with this I calculate the amount we have to pay after 5 years i.e. $5*12=60$ payments thus if we use $k=60$, $r=0.05$ and $n=20*12=240$ we get that $P=126454.98$. Now that we have the amount we still have to pay I can use the initial formula $C=\cfrac{P}{\cfrac{1-(1+r/12)^{-n}}{r/12}}$ with $P=126454.98$, $r=0.05$ and to calculate $n$ when I do this I get that $n=-138.473$ in other words I still have to pay $-138.473/12=-11.5$ years. This doesn't seem right can anyone tell me what I'm doing wrong?

Loan balance equals the NPV of future cash-flows.

Under level payments:

$P = C\sum_\limits{i=1}^{n} (\frac {1}{1+r})^i$

$P = C\frac {(1- (\frac {1}{1+r})^n)}{r}$

with stepped up payments after 5 years

$1000\sum_\limits{i=1}^{240} (\frac {1}{1.004167})^i = 1000\sum_\limits{i=1}^{60} (\frac {1}{1.004167})^i+1200\sum_\limits{i=61}^{x} (\frac {1}{1.004167})^i$

And we need to find x

$1000\sum_\limits{i=61}^{240} (\frac {1}{1+r})^i = 1200\sum_\limits{i=61}^{x} (\frac {1}{1+r})^i$

$1000\frac {(1+r)^{60} - (1+r)^{240}}{r} = 1200\frac {(1+r)^{60} - (1+r)^x}{r}\\ 200(1+r)^{60} + 1000(1+r)^{240} = 1200(1+r)^x\\ \frac {2969}{1200} = (1.004167)^x$

take the log of both sides

$x = \frac {\log 2.4744}{\log 1.04167} = 218$ total payments or 22 months shorter.