©2026 Compass Learning Technologies ← GXWeb Showcase ← GXWeb Fractured Fractions Collection → Continued Fractions: Some Alternative Forms
Continued Fractions: Some Alternative Forms
Saltire Software, home of Geometry Expressions and GXWeb
Symbolic computations on this page use Nerdamer Symbolic JavaScript to complement the in-built CAS of GXWeb
With thanks to the late Dr Keith Tognetti for pointing me in the direction of continued fractions many years ago and igniting in me a life-long passion, and to Dr Bruce Bates (both of the University of Wollongong) for revealing to us all the beautiful Stern-Brocot Continued Fraction. With colleague Dr Martin Bunder they have brought to light many wonderful and often surprising connections between binary trees and continued fractions.
Introduction to Continued Fractions
In how many different ways can you express a number like \(\frac{24}{7}\)?
As a decimal? Sure: \(3.4285714286...\)
As a mixed numeral? Perhaps... \(3 + \frac{3}{7}\)
But also as a continued fraction.
If you have not come across continued fractions in your mathematical travels, then it is high time you did!
Every real number, rational and irrational, can be represented as a continued fraction. While normal fractions can only represent rational numbers, continued fractions are different - full of surprising patterns and relationships.
Not surprisingly, rational numbers produce finite continued fractions, while irrationals become infinite continued fractions.
Unlike irrational decimals, however, even irrational continued fractions can be predictable and are an ideal way to calculate approximate values - as accurately as you like!
\[ \frac{24}{7}\]\[= 3+\frac{3}{7}\]\[= 3 + \frac{1}{\frac{7}{3}}\]\[= 3 + \cfrac{1}{2 + \cfrac{1}{3}} \]\[= 3 + \cfrac{1}{2 + \cfrac{1}{2 + \cfrac{1}{1}}} \]
\[ \sqrt{13}\]\[= 3 + \cfrac{4}{6 + \cfrac{4}{6 + \cfrac{4}{6 + \cfrac{4}{6+...}}}} \]
Simple continued fractions are calculated by repeatedly taking the floor of a real number and inverting the remainder, resulting in a string of unit values as the numerators. Negative or reversal continued fractions involve taking the ceiling of a given number and subtracting the difference.
Alternatively, simple continued fractions might be generalised by expressing the partial numerators using an integer other than 1: what might be termed non-unary simple continued fractions. Further alternative approaches might also involve setting all denominators to 1 - or even setting denominators to any constant value!
These different forms offer interesting new ways to compute and explore these fascinating mathematical creations.
The primary focus here lies with what we might define as constant denominator or inverted continued fractions (in which denominators rather than numerators are set to the same repeated value).
Two varieties are defined: Type 1 constant denominator continued fractions, for which the leading value (the floor of the real number) remains separate, and Type 2, in which the leading value is merged into the overall continued fraction. We will further define a simple constant denominator continued fraction as a constant denominator continued fraction with denominator 1.
\[\frac{24}{7} = 3 + \frac{3}{7}\] = \(3 + \cfrac{1}{2 + \cfrac{1}{2 + \cfrac{1}{1}}}\) = \(4 - \cfrac{1}{2 - \cfrac{1}{4}}\)
\(= 3 + \cfrac{2}{4 + \cfrac{2}{2 + \cfrac{2}{2}}}\) = \(3 + \cfrac{3}{7} \)\(= 3 + \cfrac{4}{9 + \cfrac{4}{11 + \cfrac{4}{4}}} \cdots \)\(= 3 + \cfrac{1}{1 + \cfrac{2}{1 + \cfrac{1}{1 + \cfrac{1}{1}}}}\)\(= 3 + \cfrac{1}{2 + \cfrac{1}{2 + \cfrac{2}{2}}}\) = \(3 + \cfrac{2}{3 + \cfrac{5}{3}} \)\(= 3 + \cfrac{2}{4 + \cfrac{3}{4 + \cfrac{2}{4}}} \cdots \)
= \(\cfrac{4}{1 + \cfrac{1}{1 + \cfrac{5}{1 + \cfrac{1}{1}}}}\) = \(\cfrac{7}{2 + \cfrac{1}{2 + \cfrac{44}{2}}}\) = \(\cfrac{11}{1 + \cfrac{1}{1 + \cfrac{6}{1 + \cfrac{1}{1}}}} \)\(= \cfrac{14}{4 + \cfrac{1}{4 + \cfrac{32}{4}}} \cdots \)
Constant Numerator Continued Fractions: \(cncf(x,n)\)
If simple continued fractions are calculated by repeatedly taking the floor of a real number and inverting the remainder, how might we set numerators (after the initial floor value) to a constant value other than 1? (Note that setting the numerator value to 1 results in the usual simple continued fraction form and cannot be thought of as non-unary). Before exploring constant denominator continued fractions it is worth a look at their cousins in which the (partial) numerators rather than the denominators are set to a constant integer value. These interesting mathematical creatures have been carefully explored in the work of Anselm and Weintraub (2011), where they find both similarities to and surprising differences from the classical case. Prior to this, E.B. Burger, J. Gell-Redman, R. Kravitz, D. Welton, N. Yates (2008) proved that every real quadratic irrational can be expressed as a periodic non-simple continued fraction having period length one. Here we demonstrate this, not just for constant numerator continued fractions, but also for the Type 1 constant denominator form.
\[cncf(\frac{24}{7},2)\]\[\frac{24}{7} = 3 + \cfrac{2}{4 + \cfrac{2}{2 + \cfrac{2}{2}}}\]\[⇒ [3:4,2,2]_{2}\]\[\approx 3.4285714285714284\]\[Convergents:\]\[[3,4,\frac{7}{2},\frac{17}{5}, \frac{24}{7}]\]\[Error = 0 \%\] [3,4,2,2]
[2,2,2,2]
\[cncf(\frac{24}{7},2)\]\[\frac{24}{7} = 3 + \frac{3}{7}\]\[= 3 + \cfrac{2}{2\cdot \frac{7}{3}}\]\[Then \ 4 = \lfloor 2\cdot \frac{7}{3}\rfloor \]\[and \ 2\cdot \frac{7}{3}-4 = \frac{2}{3} \]\[= 3 + \cfrac{2}{4 + \cfrac{2}{3}} \]\[Then \ 3 = \lfloor 2\cdot \frac{3}{2}\rfloor \]\[and \ 2\cdot \frac{3}{2}-2 = \frac{2}{2} \]\[= 3 + \cfrac{2}{4 + \frac{2}{2+\frac{2}{2}}} \]\[= \frac{24}{7}\] \[cncf(x,n)\]\[To \ begin, \ let \ a_0 = \lfloor x \rfloor, \ b_0 = x - a_0 \]\[⇒ \ x = a_0 + b_0\]\[Let \ c_0 = \lfloor \frac{n}{b_0}\rfloor \ and \ b_0 = \frac{n}{n\cdot \frac{1}{b_0}}\]\[\ Then \ let \ b_1 = \frac{n}{b_0}-c0\]\[ ⇒ x = a_0 + \cfrac{n}{c0 + b_1}\]\[Subsequent \ steps: \]\[Let \ c_1 = \lfloor \frac{n}{b_1}\rfloor \ and \ b_1 = \frac{n}{n\cdot \frac{1}{b_1}}\]\[⇒ \ b_2 = \frac{n}{b_1}-c_1 \ and \ c_2 = \lfloor \frac{n}{b_2}\rfloor \]\[ ⇒ x = a_0 + \cfrac{n}{c_0 + \cfrac{n}{c_1 + \cfrac{n}{b_2 \cdots }}} \] As described by E.B. Burger, J. Gell-Redman, R. Kravitz, D. Welton, N. Yates (2008) and others, the constant numerator form makes it possible to shrink the period length of quadratic irrationals to 1, while still making it possible to capture the convergents.
\[\sqrt{2} = \sqrt{(1^2+1)} \ = \ [1:1,1,1,1,1,1,...]_{2} = cncf(\sqrt{2},2)\] \[\sqrt{3} = \sqrt{(1^2+2)} \ = \ [1:2,2,2,2,2,2,...]_{2} = cncf(\sqrt{3},2)\] \[\sqrt{4} = 2\] \[\sqrt{5} = \sqrt{(2^2+1)} \ = \ [2:4,4,4,4,4,4,...]_{1} = cncf(\sqrt{5},4)\] \[\sqrt{6} = \sqrt{(2^2+2)} \ = \ [2:4,4,4,4,4,4,...]_{2} = cncf(\sqrt{6},2)\] \[\sqrt{7} = \sqrt{(2^2+3)} \ = \ [2:4,4,4,4,4,4,...]_{3} = cncf(\sqrt{7},3)\] \[\sqrt{8} = \sqrt{(2^2+4)} \ = \ [2:4,4,4,4,4,4,...]_{4} = cncf(\sqrt{8},4)\] \[\sqrt{9} = 3\] \[\sqrt{10} = \sqrt{(3^2+1)} \ = \ [3:6,6,6,6,6,6,...]_{1} = cncf(\sqrt{10},1)\] \[\sqrt{11} = \sqrt{(3^2+2)} \ = \ [3:6,6,6,6,6,6,...]_{2} = cfi(\sqrt{11},2)\] \[\sqrt{12} = \sqrt{(3^2+3)} \ = \ [3:6,6,6,6,6,6,...]_{3} = cncf(\sqrt{12},6)\] \[\sqrt{13} = \sqrt{(3^2+4)} \ = \ [3;6,6,6,6,6,6,...]_{4} = cncf(\sqrt{13},4)\] \[\sqrt{14} = \sqrt{(3^2+5)} \ = \ [3:6,6,6,6,6,6,...]_{5} = cncf(\sqrt{14},5)\] \[\sqrt{15} = \sqrt{(3^2+6)} \ = \ [3:6,6,6,6,6,6,...]_{6} = cncf(\sqrt{15},6)\] Can you see a pattern emerging? Can you predict the constant numerator continued fraction for any quadratic irrational of the form \(\sqrt{x^2+n}\)? Like a hint?
Type 1 Constant Denominator Continued Fractions: \(cfi(x,n)\)
If simple continued fractions are calculated by repeatedly taking the floor of a real number and inverting the remainder, how might we set denominators (after the initial floor value) to a constant value? What are termed here Type 1 Constant Denominator or Inverted Continued Fractions retain the leading term (the floor) and operate upon the fractional remainder.
\[cfi(\frac{24}{7},3)\]\[\frac{24}{7} = 3 + \cfrac{1}{1 + \cfrac{2}{1+ \cfrac{1}{1+ \cfrac{1}{1}}}}\]\[⇒ [3;1,2,1,1]_{1}\]\[\approx 3.4285714285714284\]\[Convergents:\]\[[3,4,\frac{10}{3},\frac{7}{2}, \frac{17}{5}, \frac{24}{7}]\]\[Error = 0 \%\] [3,1,1,1,1]
[1,2,1,1,0]
\[cfi(\frac{24}{7},3)\]\[\frac{24}{7} = 3 + \frac{3}{7}\]\[= 3 + \cfrac{2}{2\cdot \frac{7}{3}}\]\[where \ 2 = \lceil 3\cdot \frac{3}{7}\rceil \]\[and \ 2\cdot \frac{7}{3}-3 = \frac{5}{3} \]\[= 3 + \cfrac{2}{3 + \frac{5}{3}} \]\[= \frac{24}{7}\] \[cfi(x,n)\]\[To \ begin, \ let \ a_0 = \lfloor x \rfloor, \ b_0 = x - a_0 \]\[⇒ \ x = a_0 + b_0\]\[Let \ c_0 = \lceil n\cdot b_0\rceil \ and \ b_0 = \frac{c_0}{c_0\cdot \frac{1}{b_0}}\]\[\ Let \ b_1 = \frac{c_0}{b_0}-n\]\[ ⇒ x = a_0 + \cfrac{c_0}{n + b_1}\]\[Subsequent \ steps: \]\[Let \ c_1 = \lceil n\cdot b_1\rceil \ and \ b_1 = \frac{c_1}{c_1\cdot \frac{1}{b_1}}\]\[⇒ \ b_2 = \frac{c_1}{b_1}-n \ and \ c_2 = \lceil n\cdot b_2\rceil\]\[ ⇒ x = a_0 + \cfrac{c_0}{n + \cfrac{c_1}{n + c_2}}\cdots \] 1. First, try the constant denominator continued fraction for Eulers Number \(e\).
2. Quadratic irrationals are again of interest. Once again, these will have periodic forms - but you may need to try different denominator values to find the simplest!
For denominator 1, try \(\sqrt(2)\), \(\sqrt(5)\) and \(\sqrt(10)\) (square roots of the form \(n^2+1\)?) but \(\sqrt(6)\) and \(\sqrt(7)\) both work with denominator 4, \(\sqrt(11)\) and \(\sqrt(15)\) like denominator 6, while \(\sqrt(19)\) seems to have a preference for 8!
The challenge here lies in discovering if there is a way to predict what this will be for any given quadratic.
\[\sqrt{2} = \sqrt{(1^2+1)} \ = \ [1;1,1,1,1,1,1,...]_{2} = cfi(\sqrt{2},2)\] \[\sqrt{3} = \sqrt{(1^2+2)} \ = \ [1;2,2,2,2,2,2,...]_{2} = cfi(\sqrt{3},2)\] \[\sqrt{4} = 2\] \[\sqrt{5} = \sqrt{(2^2+1)} \ = \ [2;1,1,1,1,1,1,...]_{4} = cfi(\sqrt{5},4)\] \[\sqrt{6} = \sqrt{(2^2+2)} \ = \ [2;2,2,2,2,2,2,...]_{4} = cfi(\sqrt{6},4)\] \[\sqrt{7} = \sqrt{(2^2+3)} \ = \ [2;3,3,3,3,3,3,...]_{4} = cfi(\sqrt{7},4)\] \[\sqrt{8} = \sqrt{(2^2+4)} \ = \ [2;4,4,4,4,4,4,...]_{4} = cfi(\sqrt{8},4)\] \[\sqrt{9} = 3\] \[\sqrt{10} = \sqrt{(3^2+1)} \ = \ [3;1,1,1,1,1,1,...]_{6} = cfi(\sqrt{10},6)\] \[\sqrt{11} = \sqrt{(3^2+2)} \ = \ [3;2,2,2,2,2,2,...]_{6} = cfi(\sqrt{11},6)\] \[\sqrt{12} = \sqrt{(3^2+3)} \ = \ [3;3,3,3,3,3,3,...]_{6} = cfi(\sqrt{12},6)\] \[\sqrt{13} = \sqrt{(3^2+4)} \ = \ [3;4,4,4,4,4,4,...]_{6} = cfi(\sqrt{13},6)\] \[\sqrt{14} = \sqrt{(3^2+5)} \ = \ [3;5,5,5,5,5,5,...]_{6} = cfi(\sqrt{14},6)\] \[\sqrt{15} = \sqrt{(3^2+6)} \ = \ [3;6,6,6,6,6,6,...]_{6} = cfi(\sqrt{15},6)\] Can you see a pattern emerging? Can you predict the constant denominator continued fraction for any quadratic irrational of the form \(\sqrt{x^2+n}\)? Like a hint?
3. Further, the constant denominator continued fraction for some rationals occurs in more than one form: what might be thought of as a compact form as well as an expanded form.
For example,
\[cfi(\frac{24}{7},1) = [3;1,2,1,1]\]\(= [3;1,2,1,2,1]\)
but also
\[cfi(\frac{24}{7},3)= [3;2,5]\]\(= [3;2,6,2,2,9]\)
and
\[\frac{22}{7} = [3;1,6]\]= \([3;1,7,1,6,1,5,1,4,1,3,1,2,1]\)
and also
\[\frac{73}{17} = [4;1,3,1,3]\]= \([4;1,3,1,4,1,3,1,2,1]\)
And perhaps more dramatically
\[\frac{117}{29} = [4;1,28]\]= \([4;1,29,1,28,1,27,1,26,1,25,1,24,1,23,...]\)
(to 16 decimal places!)But why does this happen for some values and not others?
Explore...
Mathematical ToolBox
About the MathBoxes...
Hint: When entering mathematical expressions in the math boxes below (f(x), g(x) and h(x)), use the space key to step out of fractions, powers, etc. On Android, begin entry by pressing Enter.
Type simple mathematical expressions and equations as you would normally enter these: for example, "x^2[space]-4x+3", and "2/3[space]". For more interesting elements, use Latex notation (prefix commands such as "sqrt" and "nthroot3" with a backslash (\)): for example: "\sqrt(2)[space][space]". Learn More?
References
Anselm and Weintraub (2011) A generalization of continued fractions, J. Number Theory 131, 2442 - 2460.
E.B. Burger, J. Gell-Redman, R. Kravitz, D. Welton, N. Yates (2008) Shrinking the period lengths of continued fractions while still capturing convergents, J. Number Theory 128,144-153.
Topi Törmä (2019) Generalized Continued Fraction Expansions with Constant Partial Denominators, J. Aust. Math. Soc. 107, 272-288
Behind the Scenes
©2026 Compass Learning Technologies ← GXWeb Showcase ← GXWeb Fractured Fractions Collection → Continued Fractions: Some Alternative Forms