This site is supported by donations to The OEIS Foundation.

# Template:Log^*

The {{log^*}} mathematical function template returns the base ${\displaystyle \scriptstyle b\,}$ iterated logarithm of ${\displaystyle \scriptstyle x\,}$, where ${\displaystyle \scriptstyle x\,}$ is a positive real number and the base ${\displaystyle \scriptstyle b,\,b\,>\,1,\,}$ is real. (If the number of iterations exceeds 16, an error message is returned!)

## Usage

{{log^*|a positive real number|base (default e) as a positive real number greater than 1}}

or

{{log^*|a positive real number|base = base (default e) as a positive real number greater than 1}}

## Valid input

A positive real number as first argument, a positive real number greater than 1 as second argument (base, which defaults to Euler's number e).

## Examples

### Examples with valid input

Code Result Check Comment
{{log^*|1|2}} 0 {{^^|2|0}} = 1
{{log^*|2|2}} 1 {{^^|2|1}} = 2
{{log^*|4|2}} 2 {{^^|2|2}} = 4
{{log^*|16|2}} 3 {{^^|2|3}} = 16
{{log^*|65535|2}} 3
{{log^*|65536|2}} 4 {{^^|2|4}} = 65536
{{log^*|65537|2}} 4
{{log^*|1|3}} 0 {{^^|3|0}} = 1
{{log^*|3|3}} 1 {{^^|3|1}} = 3
{{log^*|26|3}} 1
{{log^*|27|3}} 2 {{^^|3|2}} = 27
{{log^*|28|3}} 2
{{log^*|7625597484986|3}} 2
{{log^*|7625597484987|3}} 3 {{^^|3|3}} = 7625597484987
{{log^*|7625597484988|3}} 3
{{log^*|1}} 0 {{^^|e|0}} = 1
{{log^*|2.718281828459}} 1 {{^^|e|1}} = 2.718281828459
{{log^*|15.154262241479}} 1 {{^^|e|2}} = 15.154262241479 (rounding error issue)
{{log^*|15.154262241479*(1+10^(-12))}} 2 {{^^|e|2}} = 15.154262241479
{{log^*|3814279.1047602}} 3 {{^^|e|3}} = 3814279.1047602
{{log^*|INF}} Log^* error: First argument must be a positive real number {{^^|e|4}} = INF (overflow!)

{{log-star|2}} 65536 = {{log^*|65536|2}}

yields

log 2 65536 = 4
Code Result Check Comment
{{log^*|{{^^|e^(1/e)|0}}|e^(1/e)}} 0 {{^^|e^(1/e)|0}} = 1
{{log^*|{{^^|e^(1/e)|1}}|e^(1/e)}} 1 {{^^|e^(1/e)|1}} = 1.4446678610098
{{log^*|{{^^|e^(1/e)|2}}|e^(1/e)}} 2 {{^^|e^(1/e)|2}} = 1.7014206956611
{{log^*|{{^^|e^(1/e)|3}}|e^(1/e)}} 3 {{^^|e^(1/e)|3}} = 1.8699612238031
{{log^*|{{^^|e^(1/e)|4}}|e^(1/e)}} 4 {{^^|e^(1/e)|4}} = 1.9895734917766
{{log^*|{{^^|e^(1/e)|4}}*(1+10^(-12))|e^(1/e)}} 4
{{log^*|{{^^|e^(1/e)|5}}|e^(1/e)}} 4 {{^^|e^(1/e)|5}} = 2.0790752101176 (rounding error issue)
{{log^*|{{^^|e^(1/e)|5}}*(1+10^(-12))|e^(1/e)}} 5
{{log^*|{{^^|e^(1/e)|6}}|e^(1/e)}} 6 {{^^|e^(1/e)|6}} = 2.1486699578385
{{log^*|{{^^|e^(1/e)|6}}*(1+10^(-12))|e^(1/e)}} 6
{{log^*|{{^^|e^(1/e)|7}}|e^(1/e)}} 7 {{^^|e^(1/e)|7}} = 2.2043914917479
{{log^*|{{^^|e^(1/e)|7}}*(1+10^(-12))|e^(1/e)}} 7
{{log^*|{{^^|e^(1/e)|8}}|e^(1/e)}} 8 {{^^|e^(1/e)|8}} = 2.2500452117089
{{log^*|{{^^|e^(1/e)|8}}*(1+10^(-12))|e^(1/e)}} 8
{{log^*|{{^^|e^(1/e)|9}}|e^(1/e)}} 9 {{^^|e^(1/e)|9}} = 2.2881539911887
{{log^*|{{^^|e^(1/e)|9}}*(1+10^(-12))|e^(1/e)}} 9
{{log^*|{{^^|e^(1/e)|10}}|e^(1/e)}} 9 {{^^|e^(1/e)|10}} = 2.3204585374295 (rounding error issue)
{{log^*|{{^^|e^(1/e)|10}}*(1+10^(-12))|e^(1/e)}} 10
{{log^*|{{^^|e^(1/e)|11}}|e^(1/e)}} 11 {{^^|e^(1/e)|11}} = 2.3481997952302
{{log^*|{{^^|e^(1/e)|11}}*(1+10^(-12))|e^(1/e)}} 11
{{log^*|{{^^|e^(1/e)|12}}|e^(1/e)}} 11 {{^^|e^(1/e)|12}} = 2.372286904328 (rounding error issue)
{{log^*|{{^^|e^(1/e)|12}}*(1+10^(-12))|e^(1/e)}} 12
{{log^*|{{^^|e^(1/e)|13}}|e^(1/e)}} 13 {{^^|e^(1/e)|13}} = 2.3934015114452
{{log^*|{{^^|e^(1/e)|13}}*(1+10^(-12))|e^(1/e)}} 13
{{log^*|{{^^|e^(1/e)|14}}|e^(1/e)}} 13 {{^^|e^(1/e)|14}} = 2.4120649600492 (rounding error issue)
{{log^*|{{^^|e^(1/e)|14}}*(1+10^(-12))|e^(1/e)}} 14
{{log^*|{{^^|e^(1/e)|15}}|e^(1/e)}} 14 {{^^|e^(1/e)|15}} = 2.4286829379472 (rounding error issue)
{{log^*|{{^^|e^(1/e)|15}}*(1+10^(-12))|e^(1/e)}} 15
{{log^*|{{^^|e^(1/e)|16}}|e^(1/e)}} 16 {{^^|e^(1/e)|16}} = 2.4435759555859
{{log^*|{{^^|e^(1/e)|16}}*(1+10^(-12))|e^(1/e)}} 16
{{log^*|{{^^|e^(1/e)|17}}|e^(1/e)}} Expression error: Unrecognized word "excessive". {{^^|e^(1/e)|17}} = 2.4570006473259 (number of iterations exceeds 16)
{{log^*|{{^^|e^(1/e)|17}}*(1+10^(-12))|e^(1/e)}} Expression error: Unrecognized word "excessive".   (number of iterations exceeds 16)

### Examples with invalid input

Code Result
{{log^*|9|-3}} Log^* error: Second argument (base) must be a positive real number greater than 1
{{log^*|9|0}} Log^* error: Second argument (base) must be a positive real number greater than 1
{{log^*|9|0.5}} Log^* error: Second argument (base) must be a positive real number greater than 1
{{log^*|9|1}} Log^* error: Second argument (base) must be a positive real number greater than 1
{{log^*|i|3}} Log^* error: First argument must be a positive real number
{{log^*|-1|3}} Log^* error: First argument must be a positive real number
{{log^*|0|3}} Log^* error: First argument must be a positive real number

```

```