Solve for p i=prt