Exercise: Fibonacci Sequence
The Fibonacci sequence F(n) can be defined by:
- F(0) = 0
- F(1) = 1
- F(n) = F(n-1) + F(n-2) for n >= 2
Part 1: Compute the sequence
Create a program which prompts the user for a value for n and also asks whether the user wants to have all numbers up to the nth displayed or just the nth in isolation.
Part 2: Golden ratio
The Golden Ratio is the limit of the ratio F(n) / F(n-1) as n tends to infinity. Amend your program to display also the value(s) of this ratio either at each step or at the final step accordingly.
Bonus points
Amend the program so that it can calculate members of the sequence where F(n) > 1010.
Solutions: Fortran.