Knowledge of the Fibonacci sequence was expressed as early as Pingala (c. 450 BC–200 BC).The Fibonacci numbers are important in the computational run-time analysis of Euclid's algorithm to determine the greatest common divisor of two integers. The Fibonacci sequence is one of the most famous formulas in mathematics.Each number in the sequence is the sum of the two numbers that precede it. So, the sequence goes: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, and so on.
Xn+2= Xn+1 + Xn
This elementary algorithm uses recursion to calculate fibonacci number for an user input number. This algorithm also serves as an example for time-complexities associated with recursion (compared to a iterative approach).
$ go build
$ ./Fibonacci-number-master
5. When prompted enter the desired integer for which fibonacci number needs to be calculated (e.g., 30 as shown below)
$ For what integer you need to calculate Fibonacci number?
30