Generalized Continued Fraction

A generalized continued fraction is an expression of the form

 b_0+(a_1)/(b_1+(a_2)/(b_2+(a_3)/(b_3+...))),
(1)

where the partial numerators a_1,a_2,... and partial denominators b_0,b_1,b_2,... may in general be integers, real numbers, complex numbers, or functions (Rockett and Szüsz, 1992, p. 1). Generalized continued fractions may also be written in the forms

 x=b_0+(a_1)/(b_1+)(a_2)/(b_2+)...
(2)

or

 x=b_0+K_(n=1)^infty(a_n)/(b_n).
(3)

Note that letters other than a_n/b_n are sometimes also used; for example, the documentation for ContinuedFractionK[f, g, {i, imin, imax}] in the Wolfram Language uses f_n/g_n.

Padé approximants provide another method of expanding functions, namely as a ratio of two power series. The quotient-difference algorithm allows interconversion of continued fraction, power series, and rational function approximations.

A small sample of closed-form continued fraction constants is given in the following table (cf. Euler 1775). The Ramanujan continued fractions provide another fascinating class of continued fraction constants, and the Rogers-Ramanujan continued fraction is an example of a convergent generalized continued fraction function where a simple definition leads to quite intricate structure.

continued fractionvalueapproximateSloane
K_(n=1)^(infty)1/k(I_1(2))/(I_0(2))0.697774...A052119
K_(n=1)^(infty)k/k(e-1)^(-1)0.581976...A073333
1+K_(n=1)^(infty)k/1sqrt(2/(epi))[erfc(2^(-1/2))]^(-1)1.525135...A111129
K_(n=1)^(infty)k/k(sqrt(e)-1)^(-1)1.541494...A113011

The value

 (A_n)/(B_n)=b_0+K_(k=1)^n(a_k)/(b_k)
(4)

is known as the nth convergent of the continued fraction.

A regular continued fraction representation (which is usually what is meant when the term "continued fraction" is used without qualification) of a number x is one for which the partial quotients are all unity (a_n=1), b_0 is an integer, and b_1, b_2, ... are positive integers (Rockett and Szüsz, 1992, p. 3).

Euler showed that if a convergent series can be written in the form

 c_1+c_1c_2+c_1c_2c_3+...,
(5)

then it is equal to the continued fraction

 (c_1)/(1-(c_2)/(1+c_2-(c_3)/(1+c_3-...)))
(6)

(Borwein et al. 2004, p. 30).

To "round" a regular continued fraction, truncate the last term unless it is +/-1, in which case it should be added to the previous term (Gosper 1972, Item 101A). To take one over a simple continued fraction, add (or possibly delete) an initial 0 term. To negate, take the negative of all terms, optionally using the identity

 [-a,-b,-c,-d,...]=[-a-1,1,b-1,c,d,...].
(7)

A particularly beautiful identity involving the terms of the continued fraction is

 ([a_0,a_1,...,a_n])/([a_0,a_1,...,a_(n-1)])=([a_n,a_(n-1),...,a_1,a_0])/([a_n,a_(n-1),...,a_1]).
(8)

There are two possible representations for a finite simple fraction:

 [a_0,...,a_n]={[a_0,...,a_(n-1),a_n-1,1]   for a_n>1; [a_0,...,a_(n-2),a_(n-1)+1]   for a_n=1.
(9)

Wolfram Web Resources

Mathematica »

The #1 tool for creating Demonstrations and anything technical.

Wolfram|Alpha »

Explore anything with the first computational knowledge engine.

Wolfram Demonstrations Project »

Explore thousands of free applications across science, mathematics, engineering, technology, business, art, finance, social sciences, and more.

Computerbasedmath.org »

Join the initiative for modernizing math education.

Online Integral Calculator »

Solve integrals with Wolfram|Alpha.

Step-by-step Solutions »

Walk through homework problems step-by-step from beginning to end. Hints help you try the next step on your own.

Wolfram Problem Generator »

Unlimited random practice problems and answers with built-in Step-by-step solutions. Practice online or make a printable study sheet.

Wolfram Education Portal »

Collection of teaching and learning tools built by Wolfram education experts: dynamic textbook, lesson plans, widgets, interactive Demonstrations, and more.

Wolfram Language »

Knowledge-based programming for everyone.