# Search NKS | Online

1 - 10 of 23 for ContinuedFraction

The table on the next page gives the continued fraction representations for various numbers. … Square roots turn out to have purely repetitive continued fraction representations. … The continued fraction representation of π .

In the case of Cos[x] – Cos[α x] each step in the generalized substitution system has a rule determined as shown on the left from a term in the continued fraction representation of (α–1)/(α+1) . In the first two examples shown α is a quadratic irrational, so that the continued fraction is repetitive, and the pattern obtained is purely nested. … Note that successive terms in each continued fraction are shown alongside successive steps in the substitution system going up the page.

The numbers of successively smaller squares (corresponding to the numbers of steps in the algorithm) turn out to be exactly ContinuedFraction[a/b] .
… In all cases, however, the relationship with continued fractions remains, as below.
… Leonhard Euler studied many continued fractions, while Joseph Lagrange seems to have thought that it might be possible to recognize any algebraic number from its continued fraction.

Continued fractions
The first n terms in the continued fraction representation for a number x can be found from the built-in Mathematica function ContinuedFraction , or from
Floor[NestList[1/Mod[#, 1]&, x, n - 1]]
A rational approximation to the number x can be reconstructed from the continued fraction using FromContinuedFraction or by
Fold[(1/#1 + #2 )&, Last[list], Rest[Reverse[list]]]
The pictures below show the digit sequences of successive iterates obtained from NestList[1/Mod[#, 1]&, x, n] for several numbers x .
… In analogy to digits in a concatenation sequence the terms in the sequence
Flatten[Table[Rest[ContinuedFraction[a/b]], {b, 2, n}, {a, b - 1}]]
are known to occur with the same frequencies as they would in the continued fraction representation for a randomly chosen number.
The pictures below show as a function of n the quantity
With[{r = FromContinuedFraction[ContinuedFraction[x, n]]}, -Log[Denominator[r], Abs[x - r]]]
which gives a measure of the closeness of successive rational approximations to x .

And as the pictures on the facing page indicate, for any curve like Sin[x] + Sin[ α x] the relative arrangements of these crossing points turn out to be related to the output of a generalized substitution system in which the rule at each step is obtained from a term in the continued fraction representation of ( α – 1)/( α + 1) .
When α is a square root, then as discussed in the previous section , the continued fraction representation is purely repetitive,
Curves obtained by adding together various sine functions.

The first m rules (which yield far more than m elements of the original sequence) are obtained for any h that is not a rational number from the continued fraction form (see page 914 ) of h by
Map[(({0 Join[#, {1}], 1 Join[#, {1, 0}]} &)[Table[0, {# - 1}]]) &, Reverse[Rest[ContinuedFraction[h, m]]]]
Given these rules, the original sequence is given by
Floor[h] + Fold[Flatten[#1 /. #2] &, {0}, rules]
If h is the solution to a quadratic equation, then the continued fraction form is repetitive, and so there are a limited number of different substitution rules.

Continued fraction representations for several numbers.

Other examples include the repetitive structure of digits in rational numbers (see page 138 ) and continued fraction terms in square roots (see page 144 ).

(The size of the region before stripes appear depends on Length[ContinuedFraction[θ/π]] .)

In general, it is given by the successive terms in the continued fraction form (see page 914 ) of this slope, and is related to substitution systems (see page 903 ).