Finding the outstanding balance on a loan Smith borrows 27,000 to purchase a new car. The car dealer finances the purchase with a loan that will require level monthly payments at the end of each month for 4 years, starting at the end of the month in which the car is purchased (assume the car is purchased on the 1st of the month). The loan has 0% interest rate for the first year followed by 5% annual nominal interest rate, compounded monthly, for the following three years. Find the outstanding balance on the loan at the end of the first year.
I thought I knew how to do this, but I got it wrong, so can I get corrected on what's going wrong please? Here is what I've got: 27,000 is the present value of all of the payments together.  The payment is always the same amount, so I'll call that $x$.  The first year has no interest to account for, so the outstanding balance is just $27,000 - 12*x$.  I think I can solve for $x$ by creating an equation where the loan amount is equal to the first 12 payments plus the present value of the following three years of payments, sent back a year with the discount factor.
$27,000 = 12x + x*\frac{1-\frac{1}{1+.05/12}^{12*3}}{.05/12}*\frac{1}{.05/12}^{12}$
$x\approx 617.258$
$27,000-617.258*12 \approx 19592.89$
 A: The interest is only ever charged on the remaining balance, which complicates things somewhat.
I'm going to assume that every month from the second year onward, the balance shifts by  $b_i \to b_i - x$, and then an interest charge of $(0.05/12)(b_i-x)$ is added. Hence $b_{i+1} = (1+0.05/12)(b_i-x)$.
You can solve $b_{i+1} = c(b_i - x)$ to find
$$b_n = b_0 c^n - \frac{c(c^n-1)x}{c-1}$$
(For example, you could write $$b_n = c(b_{n-1} - x) = c^2 b_{n-2} - cx - c^2x = c^n b_0 - cx(1 + c + c^2 + \cdots + c^{n-1})$$
and sum the geometric series.)
Substituting in $b_{36} = 0$ and $b_0 = 27000-12x$, we can solve for $x$. I'll let you finish it off.

I get the numerical answer for monthly repayments $x\approx593.35$ with the above assumptions. Two possible variations: you could use the $(1+0.05)^{1/12}$ formula instead for the interest rate; and you could apply interest before making a repayment. 
The former only changes the value of $c$. ($x\approx592.658$.) The latter changes $cx\to x$ in the solution. ($x\approx595.16$ with the $c$ value above or $x\approx594.44$ with the alternate one. These are the values of Zhuoran He.)
A: Let $A=27000$ be the amount of money borrowed. Let $r_n$ be the monthly interest rate for the $n$th month and $x$ be the level monthly payment. Then we have
$$A=\frac{x}{1+r_1}+\frac{x}{(1+r_1)(1+r_2)}+\cdots+\frac{x}{(1+r_1)(1+r_2)\cdots(1+r_N)},$$
where $N=48$ months is the time by which the loan needs to be paid in full. This is the formula for a general loan with time-varying interest rate. It can be derived using a recursive sequence and can be understood as discounting a future payment $x$ to its present value for every month. Therefore, the level monthly payment
$$x=\frac{A}{\displaystyle\sum_{i=1}^N\prod_{j=1}^i\frac{1}{1+r_j}}=\frac{27,000}{45.366}=595.16.$$
To get these numbers I used $r_j=0.05/12$ for the $2$nd to $4$th years (and $r_j=0$ for the $1$st year). If instead $r_j=1.05^{1/12}-1=0.0489/12$ was used, the answer $x=594.44$ gets slightly smaller. In case $r_j$ is piecewise constant, one can sum the denominator using the sum formula of a geometric series. Otherwise the denominator takes $\mathcal{O}(N)$ time to calculate.
