With most languages, you would use While. You can do that in Mathematica too.
Let's take a simple example first. Let's find the values of x(i) = x(i-1) +1 with x(0) = 0 while x(i) <10
You'll need an empty list that you can append values to as you find them. I've called that list "acc" below. Consider this example:
acc = {};
i = 0;
While[i < 10, AppendTo[acc, i]; i = i + 1]
acc is short for accumulator. It now holds the list: {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
Try modifying the code above to do your iteration.
Mathematica has much better ways of doing computations like this, but it's good to learn how to solve problems like this while learning how to program.