If P=amount of the loan, m=monthly payment, r=annual percentage rate, n=number of years, we can establish a formula. The monthly interest rate is r/12% and the monthly growth rate is 1+r/1200.
After a month P has grown to P(1+r/1200) and the first payment is paid which reduces the debt:
P(1+r/1200)-m. This is the new principal for the second month.
Now we apply interest: (P(1+r/1200)-m)(1+r/1200) and make the second payment:
(P(1+r/1200)-m)(1+r/1200)-m=P(1+r/1200)²-m(1+r/1200)-m.
The next month is a repetition of the process:
P(1+r/1200)³-m(1+r/1200)²-m(1+r/1200)-m.
After 12n monthly payments the debt is paid off, so:
P(1+r/1200)¹²ⁿ-m(1+r/1200)¹²ⁿ⁻¹-m(1+r/1200)¹²ⁿ⁻²-...-m(1+r/1200)²-m(1+r/1200)-m=0.
We can find the sum of the series involving m: it’s m((1+r/1200)¹²ⁿ-1)/(r/1200).
Now we can find P: P(1+r/1200)¹²ⁿ=m((1+r/1200)¹²ⁿ-1)/(r/1200).
We replace the algebraic symbols: m=$400, r=7.5%, n=5 years.
First work out the growth factor: (1+r/1200)¹²ⁿ=1.00625⁶⁰=1.4533 approx.
So 1.4533P=400(1.4533-1)/0.00625. P works out to be $19,962.12.