Solution: Huge Fibonacci Number
Solution for the Huge Fibonacci Number Problem.
Solution
In this problem, might be so huge that an algorithm looping for iterations will be too slow. Therefore, we need to avoid such a loop. To get an idea of how to solve this problem without going through all Fibonacci numbers for from to , take a look at the table below:
Stop and think: Do you see any interesting properties of the last two rows in the table above?
Both these sequences are periodic! For ...