I am going to abbreviate EMI by E and (1+r) by R
E = PrRn/(Rn - 1)
E/Pr = Rn/(Rn - 1)
(E/Pr) - 1 = [Rn/Rn - 1) - 1
(E - Pr)/Pr = 1/(Rn - 1)
Pr/(E - Pr) = Rn - 1
[Pr/(E - Pr) + 1 = Rn
E/(E - Pr) = Rn
now pass to logarithms on each side and you will have n by a simple division.
Please check my algebra very carefully...but I think this is correct!