Iterated Logarithm log * ( n ) | Recursive CPP program to find value of Iterated Logarithm ; Driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; int _log ( double x , double base ) { return ( int ) ( log ( x ) / log ( base ) ) ; } double recursiveLogStar ( double n , double b ) { if ( n > 1.0 ) return 1.0 + recursiveLogStar ( _log ( n , b ) , b ) ; else return 0 ; } int main ( ) { int n = 100 , base = 5 ; cout << " Log * ( " << n << " ) ▁ = ▁ " << recursiveLogStar ( n , base ) << " STRNEWLINE " ; return 0 ; }