Assumed answered does mean you have found your error in reasoning?
As you PM is the product of a constant and x[i. If PM<x[i and you increase x[i the relation will remain the same! So the while-loop you would have to use will run endlessly. Or did you had in mind to increase the factor in yor PM only, leaving the value to compare with unchanged?