4.8.4 Continued Fractions

A continued fraction $ a + 1/(b + 1/(c + \cdots))$ is represented in maxima by the list $ [a, b, c, \ldots]$ .

sage: maxima("cf((1 + sqrt(5))/2)")
[1,1,1,1,2]
sage: maxima("cf ((1 + sqrt(341))/2)")
[9,1,2,1,2,1,17,1,2,1,2,1,17,1,2,1,2,1,17,2]

See About this document... for information on suggesting changes.