Continued Fractions - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim

Continued Fractions

Main Concept

A continued fraction is a unique representation of a number, obtained by recursively subtracting the integer part of that number and then computing the continued fraction of the reciprocal of the remainder, if it is non-zero. If the number is rational, this process terminates with a finite continued fraction:


Otherwise, the result is called an infinite continued fraction:


Continued fractions can be used to find rational approximations to real numbers, by simply truncating the resulting fraction at a certain point. For example,  π 3+17.


The numbers appearing on the left of the expansion (the integer parts) are called coefficients.

Coefficient facts


 The continued fraction coefficients of quadratic numbers (solutions of a quadratic equation with integer coefficients) eventually repeat.


 For some non-quadratic numbers such as Euler's number e=2.718..., the coefficients have an obvious pattern: 2, 1, 2, 1, 1, 4, 1, 1, 6, 1, 1, 8, ...


 However, for almost all real numbers x, the geometric mean of the coefficients of the continued fraction expansion of x is the following number:



 which is known as Khinchin's constant.


Input a Maple expression in the box below that evaluates to a real number and click Enter, or choose one from the drop-down box. Adjust the number of approximating coefficients using the slider, and see how the coefficient frequency is affected in the graph.


# of coefficients =

More MathApps