Assume WLOG that monetary values are $'000.
Let
$r=$ interest rate $=0.1$,
$R=$annual repayment $=2$,
$a_n=$ outstanding mortgage balance at year $n$ after repayment at year $n$,
$P=a_0=$ opening mortgage balance $=40$.
The recurrence relation is
$$a_n=a_{n-1}(1+r)-R$$
Rearranging gives
$$\begin{align}
a_n-\frac Rr&=(1+r)\left(a_{n-1}-\frac Rr\right)\\
&=(1+r)^2\left(a_{n-2}-\frac Rr\right)\\
&\qquad\vdots\\
&=(1+r)^n\left(a_{0}-\frac Rr\right)\\
a_n&=(1+r)^na_0-\frac Rr[(1+r)^n-1]\\
&=\left(P-\frac Rr\right)(1+r)^n+\frac Rr\\
&=20(1.1^n+1)\qquad\blacksquare
\end{align}$$
which is the closed form solution for $a_n$.
Note that $a_n$ increases as $n$ increases, hence the outstanding mortgage balance will balloon over time and the mortgage will never be fully repaid.