Iterated logarithm
The iterated logarithm, commonly denoted as \log^*_b x (or simply \log^* x for base 2 or e), is a function in mathematics and computer science that quantifies the minimum number of iterations required to apply the base-b logarithm to a positive real number x > 1 until the result is less than or equal to 1.[1] Formally, it is defined recursively: \log^*_b x = 0 if x \leq 1, and \log^*_b x = 1 + \log^*_b (\log_b x) otherwise, making it the discrete inverse of tetration or a super-logarithm in the hierarchy of fast-growing functions.[1] This function exhibits extraordinarily slow growth, increasing by 1 only after the argument surpasses an exponential tower of 2's whose height equals the previous value; for example, \log^*_2 2 = 1, \log^*_2 4 = 2, \log^*_2 16 = 3, \log^*_2 65536 = 4, and \log^*_2 2^{65536} = 5.[2] Such sluggish growth renders \log^* n effectively constant (at most 5) for all practical computational inputs up to n \approx 10^{10^{10^{10^{10}}}}, distinguishing it from standard logarithms or polylogarithms in asymptotic analysis.[2] In computer science, the iterated logarithm prominently features in the amortized time complexity of the union-find (disjoint-set) data structure, where optimizations like union by rank and path compression achieve nearly linear performance bounded by the inverse Ackermann function \alpha(n), which grows even more slowly than \log^* n, enabling efficient handling of dynamic connectivity in graphs and other applications.[3] In mathematics, it arises in number theory, including as a slowly varying function, though it is distinct from the probabilistic law of the iterated logarithm, which describes fluctuation limits in random processes.[4]Definition and notation
Formal definition
The iterated logarithm of a positive real number n, commonly denoted \log^* n and read as "log star of n," counts the number of times the logarithm function must be iteratively applied to n before the result is less than or equal to 1.[5] This process begins with n and repeatedly takes the logarithm until the value drops to or below 1, with the total count of applications yielding \log^* n.[5] The standard recursive formulation in computer science uses the binary logarithm \lg n = \log_2 n and is given by: \lg^* n = \begin{cases} 0 & \text{if } n \leq 1, \\ 1 + \lg^* (\lg n) & \text{if } n > 1. \end{cases} [5] For n \leq 0, the function is typically undefined, as the logarithm is not defined for non-positive arguments in the real numbers.[6] When $0 < n \leq 1, \lg^* n = 0 by the base case, since no applications are needed. For $1 < n \leq 2, \lg n \leq 1, so \lg^* n = 1 + \lg^*(\lg n) = 1 + 0 = 1.[5] This definition generalizes to an arbitrary base b > 1, denoted \log_b^* n, by replacing the binary logarithm with \log_b n in the recursion: \log_b^* n = \begin{cases} 0 & \text{if } n \leq 1, \\ 1 + \log_b^* (\log_b n) & \text{if } n > 1. \end{cases} [6] The iteration proceeds similarly, counting the applications of \log_b until the result is at most 1, with the same handling for base cases and domain restrictions.[6]Notations and conventions
The iterated logarithm is commonly denoted as \log^* n (read as "log star of n"), where the asterisk indicates iteration of the logarithm function until the result is at most 1. In computer science contexts, a variant \lg^* n is frequently used to specify the base-2 logarithm, reflecting the binary nature of computational analyses. In mathematical analysis, \log^* n often defaults to the natural logarithm (base e).[7] The choice of base follows contextual conventions: base 2 is the default in computer science literature due to its alignment with binary representations and algorithmic efficiencies, while base e predominates in theoretical analysis for its compatibility with continuous functions and limits. When the base must be explicitly stated, the notation \log_b^* n is used, where b > 1 is the base.[7] These notations emerged in the 1970s within computer science, notably introduced by Robert Tarjan in his analysis of union-find algorithms, where the iterated logarithm provided tight bounds on operation complexities.[8] Earlier mathematical texts occasionally used variations such as repeated explicit logs (e.g., \log \log n), but the compact \log^* n form standardized in algorithmic contexts post-Tarjan. The function is typically defined for positive real numbers n > 0, with \log^* n = 0 when n \leq 1, as no iterations are needed to reach the threshold. For non-integer values, the definition extends naturally via the real logarithm, provided n > 0. Negative values and complex extensions are not standard, as the logarithm is undefined for non-positive reals in this context, restricting applications to positive inputs.[7]Properties
Computational values
The iterated logarithm \log^*_2 n, assuming the binary logarithm base, can be computed by repeatedly applying the logarithm until the result is at most 1, counting the number of applications required. For example, consider n = [16](/page/16): \log_2 [16](/page/16) = 4 > [1](/page/1), \log_2 4 = 2 > [1](/page/1), \log_2 2 = [1](/page/1) \leq [1](/page/1), requiring three applications, so \log^*_2 [16](/page/16) = 3.[9] The following table illustrates \log^*_2 n for select values, particularly powers of 2 expressed in Knuth's up-arrow notation, highlighting the extremely slow growth:| n | Expression in up-arrow notation | \log^*_2 n |
|---|---|---|
| 1 | - | 0 |
| 2 | - | 1 |
| 4 | $2 \uparrow\uparrow 2 | 2 |
| 16 | $2 \uparrow\uparrow 3 | 3 |
| 65{,}536 | $2 \uparrow\uparrow 4 | 4 |
| $2^{65{,}536} | $2 \uparrow\uparrow 5 | 5 |
This procedure is computationally trivial, with the loop iterating at most five times for any n encountered in real-world applications, owing to the function's minimal growth.[11] For all practical purposes, including values of n on the scale of the observable universe (approximately $10^{80} particles, or roughly $2^{266}), \log^*_2 n \leq 5.[9]function log_star_2(n): if n <= 1: return 0 count = 0 while n > 1: n = log2(n) count += 1 return countfunction log_star_2(n): if n <= 1: return 0 count = 0 while n > 1: n = log2(n) count += 1 return count