Basic Theory
The way to solve this problem is to calculate how much each payment reduces your debt after you have been repaying your loan for $n$ years. Let $r=1+R/100$, ie. this converts the interest rate from a percentage to a value you can multiply your debt by to calculate how much you owe after adding one time period's interest.
If I make a payment of $P$ at the end of the $k$th year, then we avoid paying interest on this money $n-k$ times and so we reduce our debt by $Pr^{n-k}$. We sum up the future values of all our payments:
$\sum\limits_{k=1}^n Pr^{n-k}$
If we reverse this, it is equivalent to:
$\sum\limits_{k=0}^{n-1} Pr^k$
This is a geometric series, which can be solved using the formula $\frac{ar^{n-1}}{r-1}$ where $a$ is the first term, $r$ is the factor and $n$ is the number of terms being summed. We then attempt to equate this with the debt owed after $n$ years, which is $Mr^n$.
We now compare the two equations:
$\frac{Pr^{n-1}}{r-1} = Mr^n$
Calculating $n$
We group the $r^n$ terms:
$\frac{P}{r-1} = r^n\frac{M-P}{r-1}$
$r^n = \frac{P}{M(r-1)-P}$
So we just take the $n$th log of the right hand side.
Calculating repayments
Given the principal ($M$) and the interest rate ($r$), what will my payment-per-term ($P$) be over $n$ accruation terms?
$P=\frac{Mr^n(r-1)}{r^{n-1}}$
Payments made at the start of the year
In this case, the future values of our interest payment simply become:
$\sum\limits_{k=1}^n Pr^k$
We proceed as we did before.
Notes
We could also solve this problem using present value instead of future value.
Easiest, I think, is to break it into two loans (both at $12\%$):
Loan $1$: borrow $1500$ for $8$ years, financing the interest. The total accumulated debt is then $$1500\times 1.12^8=3713.94$$
Of that, $1500$ is principle so this loan represents interest of $\fbox {2213.94}$
Loan $2$: borrow $\$1500$ for $4$ years (financing the interest payments). Pay the principle back at the end of the $4$ years BUT keep financing the interest for another $4$ years. We compute $$1500\times 1.12^4=2360.28$$ so when we repay the $1500$ we still have the accumulated interest of $860.28$. Of course we are still financing that so, four years later that interest has grown to $$860.28\times 1.12^4=\fbox {1353.67}$$
The final answer is the sum: $$2213.94+1353.67 = \fbox {3567.61}$$
Best Answer
There are two ways you can try to solve this problem. The first is try try to keep a running tab of how much is still owed at time $n$. For the sake of legibility, I am going to divide the amounts by 1000. The recursive formula you get is then:
$$a_0=150,\qquad a_{n+1}=(1+0.1)a_n-20.$$
If you compute the first few terms of this sequence, you get
$$a_1=150(1.1)-20, a_2=150(1.1)^2-20(1.1)-20, a_3=150(1.1)^3-20(1.1)^2-20(1.1)-20\ldots$$
We can factor and get a general formula
$$a_n=150(1.1)^n-20(1+1.1+1.1^2+\ldots+1.1^{n-1})$$
We have that $a_n$ is the difference of two terms: one is a geometric series, and the other is growing exponentially. We can use the formula for the sum of a geometric series to get
$$a_n=150(1.1)^n-20\frac{(1.1)^n-1}{0.1}.$$
However, we can get to this formula more quickly by reinterpreting what interest means. If you have investment opportunities, a dollar today is worth more than a dollar tomorrow, because you can invest that dollar to earn interest. If an investment of $1$ dollar today yields $1+i$ dollars tomorrow, then $1$ dollar tomorrow is worth only $1/(1+i)$ dollars today. We can then treat interest calculations as being akin to currency conversion calculations. The same way you might convert a dollar into some number of euros, when interest is computed you are converting today dollars into tomorrow dollars (or next year dollars, or whatever your interest periods are).
Now, we want to reinterpret the problem by converting all future dollar amounts into today-dollars. This has the advantage that the $150$ in our formulas never changes. It is just our initial amount measured in today dollars. However, the amount paid in future dollars has to be converted. Let $b_n$ be the amount still owed, but this time measured in today-dollars. The amount we pay back in year $n$ is then $20(1.1)^{-n}$, and so
$$b_n=150-20(1.1)^{-1}-20(1.1)^{-2}-\ldots -20(1.1)^{-n}=150-20(1.1)^{-1}\left(\frac{1-(1.1)^{-n}}{1-(1.1)^{-1}} \right).$$
If you clean up the expression slightly, you can verify that $a_n=b_n(1.1)^n$, which is what we would hope: to calculate the amount we owe at time $n$, we can do all our calculations in terms of today-dollars, and then convert today-dollars into time-$n$ dollars.
Regardless, we want to solve for the $n$ that makes $b_n=0$. We get
$$1-(1.1)^{-n}=3/4 \Longrightarrow (1.1)^{-n}=1/4 \Longrightarrow n=\log 4/\log 1.1\approx 14.55$$
However, this isn't a whole number, so we have to be careful in interpreting this "answer." Since we only pay back the loan once a year, the result tells us that we are not done after the $14$th year, but we are done by the $15$th year. Our final payment in the $15$th year will be less than the $20$ we pay every other year. To find out how much we need to reduce our final payment by, let us calculate $a_{15}\approx -8.86$. Thus, if we did pay 20 in the final year, we would have overpaid by $8.86$, and thus our final payment should be for $20-8.86=11.14$.