I need to iterate through expression several times and quit iteration process when certain value is reached but use algebraic notation. Summation notation would have worked if it didn't sum the expression and if we could quit the process when $i$ reaches certain value.
The concept is this: $$ i=0\\ \text{START ITERATION PROCESS WITH}\kern{3pt}i:\\ i=i+1\\ \text{IF}\kern{3pt}i\kern{3pt}=5\kern{3pt}\text{, STOP (CONTINUE OTHERWISE)} $$
How do you do something like this in math?
EDIT (additional information): I wouldn't know the value of $i$ in advance and that's what complicates the issue, I would only know the value after expression is finished in each iteration of the process.
Most mathematics books typically do this using a lot of natural language. For your case, you might say:
Suppose $i_{n+1}=i_n+1$ and $i_0=0$. Let us iterate over $n$ until $i_n=5$ (...).