The interest rate of 6% is not specific enough. Is it APR (Annual Percentage Rate), or is it just for the 3 months stated. Also, how often is it compounded? Is it daily, weekly monthly, quarterly, semi-annually, annually.....etc. It is very important that the interest rate be quoted very accurately, otherwise, you will get the wrong result.
As a result, I'm going to assume that your 6% interest is annual and compounded monthly. Also, I don't quite understand your formula for a monthly payment. Therefore, I'm going to use a familiar formula that is "universal" !!.
PMT=PV. R.{[1 + R]^N/ [1 + R]^N - 1}, Where R=Interest rate per period, N=number of periods, PMT=periodic payment, PV=Present value.
Under my assumption, your monthly interest rate would be =6% / 12 = 1/2%.
PMT =4,000 x 0.06/12{[1 + 0.06/12]^3 / [1 + 0.06/12]^3 - 1}
PMT =20 x {[1.005]^3 / [1.005]^3 - 1}
PMT = 20 x {1.015075125 / (1.015075125 - 1)}
PMT = 20 x {1.015075125 / 0.015075125}
PMT = 20 x 67.33444167........
PMT =$1,346.69 - This is the payment for 3 months on $4,000 loan @ 6% compounded monthly.