{ Challenge } Convert a Continued fraction to a simple fraction
Continued fraction definition can be found from the wiki page:
http://en.wikipedia.org/wiki/Continued_fractionAnd the form of it is as following picture.
Now, question is: if we know a continued fraction which is expressed by (list a0 a1 a2 a3.... an)
How to simplify it to a simple fraction (only one numerator and one denominator) list (a b)
(defun convert(lst) .............)
(convert '(0 1 3 4 6)) -> '(81 106)
From my attached picture, you may know what I means.
BTW, this question comes from my study on "Using Continued Fractions to Convert Decimals to Fractions" "
http://www.willamette.edu/~mjaneba/help/frac.html"
And I find it is a funny recursion question, I hope you enjoy it