I understand that a continued fraction is given by iterating \[; x \\rightarrow floor(x) , \\frac{1}{x - floor(x)} ;\] , but how can I reverse this? Is there a way to get from a continued fraction back to the number that generates it? Is there a formula that takes a list of numbers and returns the number that generates it?

Since \[; \[3; 1\] = \[4\] ;\], it's impossible to completely reverse it.

I've seen the \[; a\_0 + \\frac{1}{a\_1 + \\frac{1}{a\_2 + ...}} ;\] thing, but with the "..." on the right, I'm not sure how to turn it into an explicit formula.