Computation of iterated logarithm function
$\lg^* n$ is just the minimum number of times you need to apply the $\lg$ function to $n$ in order to obtain a number that is smaller than or equal to $1$.

For example, assuming that you are working with base-2 logarithms and that $n=65536$ you have the following:


$\lg^{(0)} 65536  = 65536$,
$\lg^{(1)} 65536  = \lg 65536  = 16$,
$\lg^{(2)} 65536  = \lg 16  = 4$,
$\lg^{(3)} 65536  = \lg 4  = 2$,
$\lg^{(4)} 65536  = \lg 2  = 1$.


As you can see $4$ is the smallest integer value of $i \ge 0$ for which $\lg^{(i)} 65536 \le 1$. Therefore $\lg^* 65536 = 4$.