I have a computation step where

$$
a\_{n+1} = f\_1(a\_n)
$$

That is, $a$ at step $n+1$ is some function $f\_1$ of $a$ at step $n$. 

I want to iterate till an $N$ where $f\_2(a\_N) = b$ (where $f\_2$ is some other function) 
and then at that $N$ compute $x = f\_1(a\_N)$. 

Question is how do I write this in a nice compact mathematical formula.

Thanks in advance