July 10, 2009
I was helping my daughter with her math homework recently, and came across this problem in continued fractions:
This fraction can be considered as a sequence of terms
Or, in general
The first ten elements of the sequence are 1, 2, 3/2, 5/3, 8/5, 13/8, 21/13, 34/21, 55/34, and 89/55.
Your task is to write a program that evaluates the nth element of the sequence. What is the value of ? When you are finished, you may read or run a suggested solution, or post your own solution or discuss the exercise in the comments below.