Solve for n a=p(1+nr) for n