If this relates to paying down a loan at interest i
per payment period, then you get that after n
payments at a rate of r
the reduced principal is
p*(1+i)^n-r*(1+i)^n-r*(1+i)^(n-1)-...-r*(1+i)
=
p*(1+i)^n - (1+i)*((1+i)^n-1)/i*r
If that is to be zero, loan repaid, then the necessary rate computes as
r = i/((1+i)*(1-(1+i)^(-n))) * p
which is in some aspects similar, in other fundamental aspects different from your formula.
var p = 1.500;
var n = 15;
var i = 0.06;
var x = 1+i;
var result = i/( x*( 1-Math.pow(x,-n) ) )*p;
alert(result);