calculating nth Fibonacci number in O(log n)