I dont want to discourage questions, but wouldn't it be easier to test this yourself by substituting values, rather than ask us to repeat the algebra looking for errors?

I have not checked your answer in any detail, but look at your denominator:

log( 1 + i * type)n = log[ { pmt * ( 1 + i * type) - fv * i } / { pmt * ( 1 + i * type) + pv * i } ] / log( 1 + i * type)

if type=0, then this is log(1). Log(1)=0 and so your expression is undefined (anything divided by 0 is undefined).

My suggested approach to recover n would be to re-factorise your expression into the form:

...and finish. Depending on your level of study you may impress your teacher by noticing that

PS:I have NOT checked that the equation can be re-written in the form i mentioned, but at first glance it looks like it can.