BinarySearch recursive with recursion depth tracking
calculating log(N\!)