©2023 Compass Learning Technologies → GXWeb Showcase → GXWeb Continued Fraction Collection → Continued Fractions and Magic Tables
Continued Fractions and Magic Tables
Saltire Software, home of Geometry Expressions and GXWeb
Symbolic computations on this page use the Nerdamer Symbolic JavaScript to complement the in-built computer algebra system of GXWeb.
Exploring the Magic Table for Continued Fractions
An Introduction to Continued Fraction Arithmetic
Exploring the Magic Table for Continued Fractions
Introduction: What is a Magic Table?
To convert a real number to a continued fraction is easy! Try this yourself?
But what if you want to go in the other direction? If you have a continued fraction, and would like to know the real number that it represents?
For some rational numbers (and approximations of irrationals), this is (relatively) easy, since the continued fraction is finite. For most, though, it can be quite arduous.
The most commonly used method involves starting from the bottom and working upwards. This approach, however, does not reveal the successive approximations, the convergents, which in many cases may be just as useful as the final result.
107=1+37=1+173=1+12+13=[1,2,3]
[1,2,3]=1+12+13=1+173=1+37=107
Alternatively, you might try the Magic Table method!
The magic table 1, 2 (first described by Gosper (1972) - credit for the name goes to Associate Professor Terry Gagen of the University of Sydney) offers an efficient and (relatively) simple way to generate the convergents of a continued fraction - it can even be used, in 1 or 2 dimensions, on linear fractional transformations of continued fractions and, in 3 dimensions, forms the basis for Gosper's algorithm for continued fraction arithmetic.
For example, the continued fraction of
√(37)=>a(n)=[6,12,12,12,12,12,12,...]b(n)=[1,1,1,1,1,1,1...] 6+112+112+112+112+112+112+112...Using the approaches described here is much simpler than, for example, matrix methods to calculate a result such as
√37+47=[1407]⋅√(37)=[1407]⋅[√(37)001]where the linear fractional transformation is the matrix
[1407] and [1001]represents the identity matrix.
... 12 12 12 12 12 6 a(n) ... 1 1 1 1 1 (1) b(n) ... 213442 17665 1462 121 10 1 4 ... 148183 12264 1015 84 7 0 7
Introducing the Magic Table: Dimension 1
Introducing the Magic Table: Dimension 2
For ease of presentation, in our versions, the terms are displayed vertically, with the terms of the linear fractional transformation found at the top of the numerator and denominator columns (rotated -90°).
Step by Step
General Continued Fractions: Some Examples
Try More Examples
Continued Fraction Arithmetic
Dig Deeper: Related References
Behind the Scenes
©2023 Compass Learning Technologies ← GXWeb Showcase ← GXWeb Continued Fraction Collection ← Continued Fractions and Magic Tables