TITLE: $ T(n)= T(\log n)+ \mathcal O(1) $ Recurrence Relation
QUESTION [7 upvotes]: what is the solution of following recurrence relation?
$$\begin{align}
T(1) &= 1\\
T(n) &= T(\log n) + \mathcal O(1)
\end{align}$$
a) $O(log n)$
b) $ O (log^* n) $
c) $ O (log^2 n) $
d) $ O (n / log n) $

REPLY [2 votes]: I like to think of recurrences of the form $T(n) = T(f(n)) + \Theta(1)$† as "accumulator" recurrences.  This is because they "add up" the number of iterations--or some multiple thereof--it takes for $f(n)$ to go beyond some limit.  
In words, this recurrence is determining the number of times one must take a logarithm before reaching $1$.  This should sound familiar to a computer science student, as there's a special function to describe this number!
This special function is  $\lg^*n$, which is the iterated logarithm.  Since some may not be familiar with this function, it is defined as:
$$\lg^*n:=\begin{cases}
0& n\leq 1\\
1+\lg^*(\lg(n)) & n > 1
\end{cases}$$
So, a good guess would be that $T(n) \in \Theta(\lg^*n)$.  (In fact, if we had $+1$ instead of $+\Theta(1)$, the exact solution would be: $T(n) = \lg^* n + 1$.)  The guess can be proven somewhat easily using strong induction.

†I must make an important distinction: if you are really talking about big-$\mathcal O$ notation, there isn't a unique "right answer" to this question.  This is because $\mathcal O(\cdot )$ is an upper bound for the asymptotic behavior of the recurrence, rather than a tight bound.  People often confuse $\mathcal O(\cdot)$ with $\Theta(\cdot)$.  As such, I'm assuming that the you meant $\Theta(\cdot)$ wherever you wrote $\mathcal O(\cdot)$.