The repeat X until Y methodology is a key component of many algorithms. Yet, I haven't come across a good mathematical notation for it. (Perhaps because it is of little use in manipulating expressions?)
As an example how would you write "Sum the reciprocals of natural numbers until the total is above 42." I would like to write something like:
$$\sum_{N=1}^{this\lt 42} \frac{1}{N}$$
where "this" corresponds to the partial sums.
Likewise one would like to do a similar thing with products or iterations in general e.g. "Start with 2, keep squaring until the result is no bigger than 15":
$$ (x \rightarrow x^2)^{this\lt 15}(2)$$
I mean I suppose one could fake it by using the Heaviside function $H(x)$ which is $0$ if $x\lt 0$ and $1$ if $x\geq 0$
$$ (x \rightarrow x + H(42-x)(x^2-x) )^\infty(2)$$
Which gives the same result but is not a direct translation of the English into mathematical notation. Since this is essentially saying "keep doing the iteration forever even though you're getting the same result."
The first one:
"Sum of reciprocals of natural numbers (starting with 1) until sum is above 42"
is fairly straightforward. First, the number where it goes above 42 is:
$$X = \min \left\{ x \in \mathbb{N} \,\left\vert\, \sum_{n=1}^x \frac{1}{n} >42 \right.\right\}$$
And so if you want to know what the sum is:
$$\sum_{n=1}^X \frac{1}{n}$$
Or, as one expression:
$$\sum_{n=1}^{\min \left\{x \in \mathbb{N} \,\left\vert\, \sum_{n=1}^x \frac{1}{n} >42 \right.\right\} } \frac{1}{n}$$
For the "Start with $2$ and keep squaring while result is less than 15"
you indeed need to talk about iterations of numbers. For this, we could define a recursive function. So, let $f$ be a funtion from natural numbers to natural numbers defined by:
$f(1)=2$
$f(x+1)=f(x)^2$ (for $x>1$)
And now the result we are looking for is:
$$\max \{ f(x) \mid x \in \mathbb{N}, f(x)<15 \}$$