©2026 Compass Learning Technologies ← GXWeb Showcase ← GXWeb Fractured Fractions Collection → Continued Fractions: Exploring Alternate Forms
Continued Fractions: Exploring Alternate 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 continued fraction connections from fraction trees to dragon curves and even paper folding!
Continued Fractions: Some Alternate Forms: Introduction: YouTube (6:16)
Continued Fractions: Some Alternate Forms: Exploring Rationals: YouTube (6:38)
Continued Fractions: Some Alternate Forms: Exploring Quadratics: YouTube (10:55)
Constant Numerator Continued Fractions:
\(cnm(x,n)\)Type 1 Constant Denominator Continued Fractions:
\(cdn1(x,n)\)Type 2 Constant Denominator Continued Fractions:
\(cdn2(x,n)\)\[ \frac{24}{7} = 3+\frac{3}{7}\]\[= 3 + \frac{1}{\frac{7}{3}}\]\[= 3 + \cfrac{1}{2 + \cfrac{1}{3}} \]
\[ \frac{24}{7} = 3 + \cfrac{2}{4 + \cfrac{3}{4 + \cfrac{2}{4}}} \]
\[\sqrt{13}\]\[= 3 + \cfrac{4}{6 + \cfrac{4}{6 + \cfrac{4}{6 + \cfrac{4}{6 +...}}}} \]
Introduction to Continued Fractions
\[\frac{24}{7}\]\[= 3+\frac{3}{7}\]\[= 3 + \cfrac{1}{2 + \cfrac{1}{2 + \cfrac{1}{1}}} \]\[\approx 3.142857...\]In how many different ways can you express a number like \(\frac{24}{7}\)?
As a decimal? Sure: \(3.428571428571...\)
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!
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 - and for something completely different, you might even explore continued logarithms!
Alternatively, simple continued fractions might be generalised by expressing the partial numerators using an integer other than 1: what might be termed non-unary or constant numerator continued fractions. Further alternative approaches might involve setting denominators to a constant value!
These different forms offer interesting new ways to compute and explore these fascinating mathematical creatures.
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 (or inverted) 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.
The latter Type 2 Constant Denominator Continued Fractions arise from the work of Topi Törmä (University of Oulu, Finland): Generalized Continued Fraction Expansions with Constant Partial Denominators (2019).
Type 1 Constant Denominator continued fractions - or Inverted Continued fractions - appear in the more usual form, with the floor of the real number preceding the fractional part. In researching this topic, I have been unable to find much in the way of published research on this form of generalised continued fraction.
We might 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 + \frac{1}{\frac{7}{3}} = 3 + \frac{1}{2 + \frac{1}{3}}\] = \(3 + \cfrac{1}{2 + \cfrac{1}{2 + \cfrac{1}{1}}}\) = \(4 - \cfrac{1}{2 - \cfrac{1}{4}}\) = \(2 + \cfrac{2}{1 + \cfrac{1}{2 + \cfrac{2}{4}}}\)
= \(3 + \cfrac{1}{2 + \cfrac{1}{2 + \cfrac{1}{1}}}\)\(= 3 + \cfrac{2}{4 + \cfrac{2}{2 + \cfrac{2}{2}}}\) = \(= 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}{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 \)
Clearly, each of the three alternate forms offers countably infinite continued fraction variations for any given rational.
Exploring Quadratic Irrationals
Quadratic irrationals offer particular interest in this exploration - although Euler's number \(e\) does deserve a special mention! While simple quadratic irrationals ARE periodic, those periods frequently prove to be tricky: for example,
While \( \sqrt{2} = [1,<2,2>]\) and \( \sqrt{3} = [1,<1,2>]\)
\(\sqrt{13} = [3,<1,1,1,6>]\) and \( \ \sqrt{19} = [4,<2,1,3,1,2,8>]!\)
You might have noticed that an example above brings together the properties of both constant numerator and Type 1 inverted continued fractions! A well-established formula for generalised quadratic irrationals allows a generalised continued fraction of the square root of any integer to be quickly and easily computed - in your head!
\[ \sqrt{13} = \sqrt{3^2+4}\]\[= cnm(\sqrt{(13)},4)\]\[= cdn1(\sqrt{(13)},6)\]\[\approx 3 + \cfrac{4}{6 + \cfrac{4}{6 + \cfrac{4}{6 + \cfrac{4}{6 +...}}}} \] \[ \sqrt{a^2+b}\]\[= cnm(\sqrt{(a)},b)\]\[= cdn1(\sqrt{(a)},2\cdot a)\]\[\approx a + \cfrac{b}{2\cdot a + \cfrac{b}{2\cdot a + \cfrac{b}{2\cdot a + \cfrac{b}{2\cdot a +...}}}} \] The same approach with some Type 2 inverted forms secures a period 2 expansion. It takes an even constant denominator to deliver that elusive period 1 - and the resulting continued fraction can converge quite slowly!
\[ \sqrt{13} = \sqrt{3^2+4}\]\[= cdn2(\sqrt{(13)},3)\]\[\approx \cfrac{13}{3 + \cfrac{4}{3 + \cfrac{13}{3 + \cfrac{4}{3 + \cfrac{13}{3 +...}}}}} \] \[ \sqrt{13} = \sqrt{3^2+4}\]\[= cdn2(\sqrt{(13)},4)\]\[\approx \cfrac{26}{4 + \cfrac{18}{4 + \cfrac{9}{4 + \cfrac{9}{4 + \cfrac{9}{4 +...}}}}} \] Time, perhaps, for another look at that tricky \(\sqrt{19}\) - and others?
\[cnm(\sqrt{19},1) =\]\[ [4,<2,1,3,1,2,8>]_1\]\[But \ then \ cnm(\sqrt{19},2) =\]\[ [4,5,3,4,34,4,3\cdots ]_2\]\[And \ cnm(\sqrt{19},3) =\]\[ [4,<8,8,8>]_3\]
\[cnm(\sqrt{19},1) \approx 4 + \cfrac{1}{2 + \cfrac{1}{1 + \cfrac{1}{3 + \cfrac{1}{1 + \cfrac{1}{2 + \cfrac{1}{8 +...}}}}}}\]\[cnm(\sqrt{19},3) \approx 4 + \cfrac{3}{8 + \cfrac{3}{8 + \cfrac{3}{8+ \cfrac{3}{8 +...}}}} \]
\[cdn1(\sqrt{19},1) =\]\[ [4,1,2,1,8,1,11,1,20\cdots ]_1\]\[But \ cdn1(\sqrt{19},7) =\]\[ [4,<3,10>]_7\]\[And \ cdn1(\sqrt{19},8) =\]\[ [4,<3,3,3>]_8\]
\[cdn1(\sqrt{19},1) \approx 4 + \cfrac{1}{1 + \cfrac{1}{2 + \cfrac{1}{1+ \cfrac{1}{8 + \cfrac{1}{1 + \cfrac{1}{11 +...}}}}}} \]\[cdn1(\sqrt{19},8) \approx 4 + \cfrac{3}{8 + \cfrac{3}{8 + \cfrac{3}{8+ \cfrac{3}{8 +...}}}} \]
\[cdn2(\sqrt{19},1) =\]\[ [<19,18>]_1\]\[(Method \ 3)\]\[cdn2(\sqrt{19},4) =\]\[ [<19,3>]_4\]\[(Methods \ 1 \ and \ 3)\]\[cdn2(\sqrt{19},4) =\]\[ [38,30,<15>]_4\]\[(Method \ 2)\]
\[cdn2(\sqrt{19},1) \approx \cfrac{19}{1 + \cfrac{18}{1 + \cfrac{19}{1 + \cfrac{18}{1 + \cfrac{19}{1 + \cfrac{18}{1 ...}}}}}} \]\[cdn2(\sqrt{19},4) \approx \cfrac{38}{4 + \cfrac{30}{4 + \cfrac{15}{4 + \cfrac{15}{4 + \cfrac{15}{4 + \cfrac{15}{4 ...}}}}}} \]
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.
\[\sqrt{2} = \sqrt{(1^2+1)} \ = \ [1:2,2,2,2,2,2,...]_{1} = cnm(\sqrt{2},1)\] \[\sqrt{3} = \sqrt{(1^2+2)} \ = \ [1:2,2,2,2,2,2,...]_{2} = cnm(\sqrt{3},2)\] \[\sqrt{4} = 2\] \[\sqrt{5} = \sqrt{(2^2+1)} \ = \ [2:4,4,4,4,4,4,...]_{1} = cnm(\sqrt{5},4)\] \[\sqrt{6} = \sqrt{(2^2+2)} \ = \ [2:4,4,4,4,4,4,...]_{2} = cnm(\sqrt{6},2)\] \[\sqrt{7} = \sqrt{(2^2+3)} \ = \ [2:4,4,4,4,4,4,...]_{3} = cnm(\sqrt{7},3)\] \[\sqrt{8} = \sqrt{(2^2+4)} \ = \ [2:4,4,4,4,4,4,...]_{4} = cnm(\sqrt{8},4)\] \[\sqrt{9} = 3\] \[\sqrt{10} = \sqrt{(3^2+1)} \ = \ [3:6,6,6,6,6,6,...]_{1} = cnm(\sqrt{10},1)\] \[\sqrt{11} = \sqrt{(3^2+2)} \ = \ [3:6,6,6,6,6,6,...]_{2} = cnm(\sqrt{11},2)\] \[\sqrt{12} = \sqrt{(3^2+3)} \ = \ [3:6,6,6,6,6,6,...]_{3} = cnm(\sqrt{12},6)\] \[\sqrt{13} = \sqrt{(3^2+4)} \ = \ [3;6,6,6,6,6,6,...]_{4} = cnm(\sqrt{13},4)\] \[\sqrt{14} = \sqrt{(3^2+5)} \ = \ [3:6,6,6,6,6,6,...]_{5} = cnm(\sqrt{14},5)\] \[\sqrt{15} = \sqrt{(3^2+6)} \ = \ [3:6,6,6,6,6,6,...]_{6} = cnm(\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?
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 any quadratic irrational, while still making it possible to capture the convergents.
In contrast to constant numerator continued fractions, 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.
\[\sqrt{2} = \sqrt{(1^2+1)} \ = \ [1;1,1,1,1,1,1,...]_{2} = cdn1(\sqrt{2},2)\] \[\sqrt{3} = \sqrt{(1^2+2)} \ = \ [1;2,2,2,2,2,2,...]_{2} = cdn1(\sqrt{3},2)\] \[\sqrt{4} = 2\] \[\sqrt{5} = \sqrt{(2^2+1)} \ = \ [2;1,1,1,1,1,1,...]_{4} = cdn1(\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} = cdn1(\sqrt{7},4)\] \[\sqrt{8} = \sqrt{(2^2+4)} \ = \ [2;4,4,4,4,4,4,...]_{4} = cdn1(\sqrt{8},4)\] \[\sqrt{9} = 3\] \[\sqrt{10} = \sqrt{(3^2+1)} \ = \ [3;1,1,1,1,1,1,...]_{6} = cdn1(\sqrt{10},6)\] \[\sqrt{11} = \sqrt{(3^2+2)} \ = \ [3;2,2,2,2,2,2,...]_{6} = cdn1(\sqrt{11},6)\] \[\sqrt{12} = \sqrt{(3^2+3)} \ = \ [3;3,3,3,3,3,3,...]_{6} = cdn1(\sqrt{12},6)\] \[\sqrt{13} = \sqrt{(3^2+4)} \ = \ [3;4,4,4,4,4,4,...]_{6} = cdn1(\sqrt{13},6)\] \[\sqrt{14} = \sqrt{(3^2+5)} \ = \ [3;5,5,5,5,5,5,...]_{6} = cdn1(\sqrt{14},6)\] \[\sqrt{15} = \sqrt{(3^2+6)} \ = \ [3;6,6,6,6,6,6,...]_{6} = cdn1(\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?
As mentioned, a similar approach arises from the work of Topi Törmä (University of Oulu, Finland): Generalized Continued Fraction Expansions with Constant Partial Denominators (2019), proving that, for any rational number, there exist infinitely many finite, periodic and aperiodic expansions, and that for any quadratic irrational number there exist infinitely many periodic and aperiodic expansions.
Unlike their more predictable Type 1 cousins, these inverted continued fractions may be periodic, but not according to any one formula!
In fact, Törmä defines three distinct formulae for the Type 2 quadratics:
Method 1: When \(\sqrt{d} = \sqrt{a^2+b}\) then
\[cdn2(\sqrt{d},a) = [\lt d,b,d,b,d,b\gt]_a\]Method 2: When the constant denominator is an even integer \(2\cdot m\) then
\[cdn2(\sqrt{d},2\cdot m) = \]\[[2\cdot K\cdot d, 2\cdot (K^{2}\cdot d-m^2), \lt K^{2}\cdot d-m^2 \gt]_2\cdot m\]\[where \ K \ is \ a \ positive \ integer \ value \ such \ that \]\[K\cdot \sqrt{d} \gt m\]\[and \ D = k^2\cdot d - m^2\]Method 3: A general form, for \(\frac{P + \sqrt(d)}{Q}\) then
\[Given \ d \geq 2, \ not \ a \ perfect \ square, \ and \ Q | (P-d^2),\]\[then \ for \ Q1 = |\frac{(d-P²)}{Q}|, |P| \lt \sqrt{d},\]\[and \ k \ a \ positive \ integer \ such \ that\]\[k\cdot (\sqrt{d}-P) \lt N \ then\]\[cdn2(\frac{P + \sqrt{d}}{Q},N) = \]\[[k\cdot Q1,\lt D-2\cdot k\cdot P\cdot N-N^2,D\gt]_N\]The challenge here lies in determining which method yields an optimal approximation for the given quadratic irrational.
\[\sqrt{x}\] \[cdn2\] \[cdn2(\sqrt{2},1)\]\[cdn2(\sqrt{2},2)\]\[cdn2(\sqrt{2},3)\]\[cdn2(\sqrt{2},4)\]\[cdn2(\sqrt{2},5)\]\[cdn2(\sqrt{2},6)\]\[cdn2(\sqrt{2},7)\]\[cdn2(\sqrt{2},8)\]\[cdn2(\sqrt{2},9)\]\[cdn2(\sqrt{2},10)\] \[[2,1,2,1,2,1,2...]_{1}\]\[[4,2,1,1,1,1,1...]_{2}\]\[[6,9,18,9,18,9,18...]_{3}\]\[[8,8,4,4,4,4,4,...]_{4}\]\[[8,7,32,7,32,7,32...]_{5}\]\[[12,18,9,9,9,9,9,...]_{6}\]\[[10,1,50,1,50,1,50...]_{7}\]\[[12,4,2,2,2,2,2...]_{8}\]\[[14,17,98,17,98,17...]_{9}\]\[[16,14,7,7,7,7...]_{10}\] \[cdn2(\sqrt{3},1)\]\[cdn2(\sqrt{3},2)\]\[cdn2(\sqrt{3},10)\] \[[2,1,6,1,10,1,6...]_{1}\]\[[6,4,2,2,2...]_{2}\]\[[18,4,2,2,2...]_{10}\] \[cdn2(\sqrt{5},1)\]\[cdn2(\sqrt{5},2)\]\[cdn2(\sqrt{5},11)\] \[[5,4,5,4,5,4,5...]_{1}\]\[[5,1,5,1,5,1,5...]_{2}\]\[[25,2,1,1,1,1,1...]_{11}\] \[cdn2(\sqrt{6},1)\]\[cdn2(\sqrt{6},2)\]\[cdn2(\sqrt{6},15)\] \[[3,1,4,1,6,1,7,1,7...]_{1}\]\[[12,10,5,5,5,5,5...]_{2}\]\[[37,2,61,3,3,3...]_{15}\] Can you see patterns emerging? Can you predict Type 2 constant denominator continued fractions for any quadratic irrational?
Even More Alternatives!
E.B. Burger, J. Gell-Redman, R. Kravitz, D. Welton, N. Yates (2008) describe an alternative constant numerator continued fraction form which, in some cases, can offer a simplified process.
For a real number \(\alpha\) with simple continued fraction
\[\alpha = [a_0,a_1,a_2,a_3,a_4,a_5\cdots ]\]Then a constant numerator form for \(\alpha\) with partial numerator N =
\[\alpha = [a_0,N\cdot a_1,a_2,N\cdot a_3,a_4,N\cdot a_5\cdots ]\]The simple continued fraction form for
\[\frac{24}{7} = [3,2,2,1]\]A constant numerator form with partial numerator 2
\[cnm2(\frac{24}{7},2)\]\[⇒ [3:4,2,2]_2\]\[⇒ 3 + \cfrac{2}{4 + \cfrac{2}{2 + \cfrac{2}{2}}}\]While the step by step computation process for each term of Type 1 and Type 2 constant denominator continued fractions is essentially the same, Type 2 differs from Type 1 by merging the leading term of the given real number (the floor) into the continued fraction.
\[cdn1(\frac{24}{7},1) = 3 + \cfrac{1}{1 + \cfrac{2}{1+ \cfrac{1}{1+ \cfrac{1}{1}}}}\] \[cdn2(\frac{24}{7},1) = \cfrac{4}{1 + \cfrac{1}{1+ \cfrac{5}{1}}}\] \[cdn1(\frac{24}{7},3) = 3 + \cfrac{2}{3 + \cfrac{5}{3}}\] \[cdn2(\frac{24}{7},3) = \cfrac{11}{3 + \cfrac{1}{3+ \cfrac{6}{3+ \cfrac{1}{3}}}}\] Consequently, for real number values between 0 and 1, the different approaches described here will result in identical continued fractions.
\[cdn1(\frac{5}{17},6) = 0 + \cfrac{2}{6 + \cfrac{5}{6+ \cfrac{2}{6+ \cfrac{12}{6}}}}\] \[cdn2(\frac{5}{17},6) = \cfrac{2}{6 + \cfrac{5}{6+ \cfrac{2}{6+ \cfrac{12}{6}}}}\] \[cdn1(\sqrt{37}-6,1) = 0 + \cfrac{1}{1 + \cfrac{12}{1+ \cfrac{1}{1+ \cfrac{12}{1+\cdots }}}}\] \[cdn2(\sqrt{37}-6,1) = \cfrac{1}{1 + \cfrac{12}{1+ \cfrac{1}{1+ \cfrac{12}{1+\cdots }}}}\] What remains challenging may be predicting what might be thought of as optimal values of n for rationals and periodic irrationals: arrays of minimal length for rational values, and periodic elements for irrationals. On a cautionary note, it appears that some such minimal period length forms may in fact converge much more slowly than their less predictable standard forms. In this sense, they might perhaps be considered less than optimal?
Constant Numerator Continued Fractions: \(cnm(x,n)\)
\[cnm(\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,\frac{7}{2},\frac{17}{5}, \frac{24}{7}]\]\[Error = 0 \%\] [3,4,2,2]
[2,2,2,2]\[\frac{24}{7} = [3,2,3]\]\[cnm2(\frac{24}{7},2)\]\[⇒ [3:4,3]_2\]\[⇒ 3 + \cfrac{2}{4 + \cfrac{2}{3}}\]\[\approx 3.4285714285714284\]\[Convergents:\]\[[3,\frac{7}{2}, \frac{24}{7}]\]\[Error = 0 \%\]
\[cnm(\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}\] \[cnm(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}{c_2 + \cdots }}} \]
Type 1 Constant Denominator Continued Fractions: \(cdn1(x,n)\)
\[cdn1(\frac{24}{7},1)\]\[\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]
\[cdn1(\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}\] \[cdn1(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 \]
Type 1 constant denominator continued fractions for some rationals occur in more than one form: what might be thought of as a compact form as well as an expanded form.
For example,
\[cdn1(\frac{24}{7},1) = [3;1,2,1,1]_1\]\(= [3;1,2,1,2,1]_1\)
and
\[\frac{24}{7} = [3;2,5]_3\]= \([3;2,6,2,2,9]_3\)
but also
\[\frac{22}{7} = [3;1,6]_1\]= \([3;1,7,1,6,1,5,1,4,1,3,1,2,1]_1\)
and
\[\frac{73}{17} = [4;1,3,1,3]_1\]= \([4;1,3,1,4,1,3,1,2,1]_1\)
And perhaps more dramatically
\[\frac{117}{29} = [4;1,28]_1\]= \([4;1,29,1,28,1,27,1,26,1,25,1,24,1,23,...]_1\)
(to 16 decimal places!)But why does this happen for some values and not others?
Why, for example, do expanded forms for \(\frac{33}{13}\) exist for all denominator values from 1 to 9 - except for 4?
Explore...
Type 2 Constant Denominator Continued Fractions: \(cdn2(x,n)\)
\[cdn2(\frac{24}{7},3)\]\[⇒\]
\[\frac{24}{7} = \cfrac{11}{3+\cfrac{1}{3+\cfrac{6}{3+\cfrac{1}{3}}}}\] [11,1,6,1]
[3,3,3,3]\[⇒ [11,1,6,1]_{3}\]\[\approx 3.4285714285714284\]\[Convergents:\]\[[\frac{11}{3},\frac{33}{10},\frac{55}{16}, \frac{24}{7}]\]\[Error: \ 0\%\]
Some Examples ⇓
The Challenge: To find an optimal value of \(n\) for each real number.
\[\frac{5}{17}\] \[1\]\[10\] \[[1,3,1,3]_1\]\[[3,2]_{10}\] \[\frac{24}{7}\] \[1\]\[3\] \[[4,1,5]_1\]\[[11,1,6,1]_3\] \[\sqrt{2}\] \[1\]\[2\]\[7\]\[8\] \[[1,2,1,2,1,2,1,2...]_1\]\[[3,1,13,1,21,1,24,1,27,1,136,1,140,1,7849...]_2\]\[[10,1,50,1,50,1,50...]_7\]\[[12,4,2,2,2,2,2...]_8\] \[\pi\] \[1\]\[2\] \[[4,1,3,1,7,1,37,1,71,1,449,1,657,1,991...]_1\]\[[7,1,5,1,17,1,20,1,108,1,204,1,239,1,326...]_2\] \[e\] \[1\]\[7\] \[[3,1,9,1,24,1,65,1,67,1,335,1,881,1,1152... ]_1\]\[[20,3,10,2,23,2,5,6,4,5,9,2,4,2,22... ]_7\] \[e-2\] \[1\] \[[1,1,2,1,3,1,4,1,5,1,6,1,7,1,8... ]_1\] Study the first and last examples: Can you see a connection with our Type 1 constant denominator continued fractions?
\[cdn2(\frac{24}{7},3)\]\[\frac{24}{7} = \frac{11}{11\cdot \frac{7}{24}}\]\[where \ 11 = \lceil 3\cdot \frac{24}{7}\rceil \]\[11\cdot \frac{7}{24}-3 = \frac{5}{24} \]\[\frac{24}{7}= \frac{11}{3 + \frac{5}{24}} = \frac{11}{3 + \frac{1}{1 \cdot \frac{24}{5}}}\]\[where \ 1 = \lceil 3\cdot \frac{5}{24}\rceil \]\[1\cdot \frac{24}{5}-3 = \frac{9}{5} \]\[\frac{24}{7} = \frac{11}{3 + \frac{1}{3 + \frac{9}{5}}}= \frac{11}{3 + \frac{1}{3 + \frac{6}{6\cdot \frac{5}{9}}}}\]\[where \ 6 = \lceil 3\cdot \frac{9}{5}\rceil \]\[6\cdot \frac{5}{9}-3 = \frac{3}{9} = \frac{1}{3} \]\[\frac{24}{7} = \frac{11}{3 + \frac{1}{3 + \frac{9}{5}}}= \frac{11}{3 + \frac{1}{3 + \frac{6}{3 + \frac{1}{3}}}}\] \[cdn2(x,n)\]\[To \ begin, \ let \ c_0 = \lceil n\cdot x\rceil \ and \ x = \frac{c_0}{c_0\cdot \frac{1}{x}}\]\[\ Let \ b_0 = \frac{c_0}{x}-n\]\[ ⇒ x = \cfrac{c_0}{n + b_0}\]\[Subsequent \ steps: \]\[Let \ c_1 = \lceil n\cdot b_0\rceil \]\[⇒ x = \frac{c_0}{n + \frac{c1}{c_1\cdot \frac{1}{b_0}}}\]\[Then \ b_1 = \frac{c_1}{b_0}-n \ and \ c_2 = \lceil n\cdot b_1\rceil\]\[ ⇒ x = \cfrac{c_0}{n + \cfrac{c_1}{n + \frac{c_2}{n + \cdots}}} \] As noted above, Topi Törmä digs deeply into these remarkable mathematical creatures, especially the quadratic irrationals. He proves, initially, that while there are uncountably many aperiodic Type 2 forms for any quadratic, there are countably many periodic forms. Unlike the Type 1 forms, there is no single formula that will reliably deliver these periodic continued fractions - but there are several ways that will do so, including the following.
\[Define \ \tau_{0} = \sqrt{a^2+b} = [\lt a^2+b,b\gt ]_{a}\]Example:
\[cdn2(\sqrt{17},4) = cdn2(\sqrt{4^2+1},4) = [\lt 17,1\gt]_{4}\]\[= [17,1,17,1,17,1...]_{4}\]\[Define \ \tau_{0} = \sqrt{d} \ with \ n = 2\cdot m\]Assume \(d\) is a positive integer and not a perfect square.
If \(m\) is a positive integer, then
\[\sqrt(d) = [2\cdot k\cdot d, 2\cdot (k^2\cdot d - m^2), \lt k^2\cdot d - m^2\gt ]_{2\cdot m}\]where \(k\) is a positive integer such that \(k\cdot \sqrt(d) \gt m\).
The least solution may be readily found by taking the ceiling value: \(k = \lceil \frac{m}{\sqrt{d}} \rceil\).
Example:
\[cdn2(\sqrt{2},14) = [20,2,\lt1\gt]_{14} = [20,2,1,1,1,1,1...]_{14}\]Törmä actually begins by defining a general positive quadratic irrational \(\tau_{0}\):
\[\tau_{0} = \frac{\sqrt{d} + P}{Q}\]for integers, \(P\), \(Q\) and \(d\) such that \(d \geq 2\) and is not a perfect square,
Then define \(Q' = |(d - P^2)/Q| = |\sqrt{d} - P|\cdot \tau_{0}\).
\[\tau_{0} = \frac{\sqrt{d} + P}{Q}\]\[= [a_1, a_2, a_3,a_4,a_5,\cdots ]_N\]Define integers, \(P_0 = P\), \(Q_0 = Q\) and \(R_0 = 1\). Let \(k_1\) be the smallest positive integer such that \(k_1\cdot |\sqrt(d)-P_0| \lt N\), and \(a_1 = k_1\cdot Q'\). Then
\[\tau_1 = \frac{a_1}{\tau_0} - N = \frac{k_1\cdot |\sqrt(d)-P_0|\cdot \tau_0}{\tau_0} = k_1\cdot |\sqrt(d)-P_0| - N \gt 0\]\[⇒ k_1 = \lceil \frac{N}{|\sqrt(d)-P_0|}\rceil \]Now we denote \(\tau_1 = R_1\cdot \sqrt(d) + P_1\), where
\(R_1 = k_1\) and \(P_1 = -k_1\cdot P_0 -N\) when \(\sqrt(d) \gt P_0\), and
\(R_1 = -k_1\) and \(P_1 = k_1\cdot P_0 -N\) when \(\sqrt(d) \lt P_0\), and
In general, if \(\tau_i = R_i\cdot \sqrt(d) + P_i\), then
\[a_{i+1} = k_{i+1}\cdot |R_{i}^2\cdot d - P_{i}^2|\]where \(k_{i+1}\) is the smallest positive integer such that
\[k_{i+1}\cdot |R_{i}^2\cdot d - P_{i}^2| \gt N\]\[⇒ k_{i+1} = \lceil \frac{N}{|R_{i}^2\cdot d - P_{i}^2|}\rceil \]\[⇒ \tau_{i+1} = \frac{|R_{i}^2\cdot d - P_{i}^2|}{R_i\cdot \sqrt(d) + P_i} - N = k_{i+1}\cdot |R_i\cdot \sqrt(d) - P_i| - N \gt 0\]Then \(\tau_{i+1} = R_{i+1}\cdot \sqrt(d) + P_{i+1}\), where
\(R_{i+1} = k_{i+1}\cdot R_i\) and \(P_{i+1} = -k_{i+1}\cdot P_i - N\) when \(R_{i}\cdot \sqrt(d) \gt P_i\), and
\(R_{i+1} = -k_{i+1}\cdot R_i\) and \(P_{i+1} = k_{i+1}\cdot P_i - N\) when \(R_{i}\cdot \sqrt(d) \lt P_i\).
We just need to establish that
\[\tau_{0} = \frac{\sqrt{d} + P}{Q}\]\[= [a_1, a_2, a_3,a_4,a_5,\cdots ]_N\]is periodic. Törmä proves that there exists a \(j \geq 1\) such that \(R_j\) is positive and
\[|P_j| \lt |R_j\cdot \sqrt(d)| = R_j\cdot \sqrt(d) = \sqrt{R_j^2\cdot d}\]\[\tau_{0} = \frac{\sqrt{d} + P}{Q}\]\[= [a_1, a_2, a_3,\cdots ,a_j, D/k_{j+1}, \lt D-2\cdot k_{j+1}\cdot P_j\cdot N - N^2, D\gt ]_N\]\[where \ D = k_{j+1}^2\cdot (R_j^2\cdot D - P^2_j)\]Example:
Let \(tau_0 = \frac{7+\sqrt{10}}{13}\) and \(N=4\). Then
\[cdn2(\frac{7+\sqrt{10}}{13},4) = [6,60,52, \lt 36,676 \gt ]_{4} \]\[= [6,60,52,36,676,36,676...]_{4}\]
\[k_1 = 2\] \[a_1 = 6\] \[\tau_1 = 10-2\sqrt{10}\] \[k_2 = 1\] \[a_2 = 60\] \[\tau_2 = 6+2\sqrt{10}\] \[k_3 = 13\] \[a_3 = 52\] \[\tau_3 = 26\cdot \sqrt{10}-82\] \[k_4 = 1\] \[a_4 = 36\] \[\tau_4 = 26\cdot \sqrt{10} + 78\] \[k_5 = 1\] \[a_5 = 676\] \[\tau_5 = 26\cdot \sqrt{10} - 82 = \tau_3\]
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?
\(f(x)\)
\(g(x)\)
\(h(x)\)
\(a = \) -1 5 0 \(b = \) -1 5 0 \(c = \) -1 5 0 \(d\) -1 0 5 \(e\) -1 0 5
Continued Fraction Spreadsheet Explorer
This browser-based spreadsheet uses the handsontable JavaScript library.
WolframAlpha: CAS+
Sometimes, to deal with those stubborn, hard to reach problems, you need something stronger!
The powerful Wolfram Alpha online CAS engine will answer almost anything you care to ask - within reason! From the continued fraction of pi to Solve x^2=x+1 to the population of Australia!
GeoGebra
GeoGebra offers another fast and accurate CAS alternative. You may also like to explore the GeoGebra web app.
Timing: Key Signature:
Share with QR Code
QR Codes are a great way to share data and information with others, even when no Internet connection is available. Most modern devices either come equipped with QR readers in-built, or freely available.
The default link here is the GXWeb Jigsaws and Quizzes, but you can use it as an alternative to sending your assessment data via email, web or share with others in your class. You can even use it to send your own messages!
GXWeb Jigsaws and Quizzes
Share Your Results
Enter your name:
My class:
Email to:
Session report length: 0 characters.
Turtle Robot Controls
Imagine designing, building and even remotely controlling your own robot! It is probably easier than you might think!
Alternatively, grab a TI Innovator Robot already made and follow the directions to "hack the hub"!
Watch the YouTube video of our GX Robot.
Follow the tutorial step-by-step directions to build and program your Arduino or TI Innovator robot.
NOTE: If using iPad or iPhone, you will need to grab the free Bluefy app to access webBluetooth since most browsers on this platform do not have this capability.
Then just connect and use your LOGO commands to steer - or use the controls below to connect and drive!
NOTE: Different surfaces and different robots will require different traction values. Try different values for distance and turn angle here until you find those that work best for your situation.
Distance Traction
Turn Traction
Manual Robot Controls
Construct your own Model with GXWeb
Set GXWeb Pythagorean Circles
What is the area of the inCircle for a 3-4-5 triangle?Explore Further: GXWeb Incircles Explorer
Set GXWeb Descartes Circle Theorem
Given three kissing circles of radius a, b and c (curvature \(\frac{1}{a}, \frac{1}{b}, \frac{1}{c}\)) what will be the curvatures of the inner and outer kissing circles?Explore Further: Descartes' Kissing Circles Theorem
Set GXWeb Dragon Curve/Paperfold
(In the numeric control panel, drag f slider (5 folds) from 90 to 0, then repeat for e (4 folds), d (3 folds), c (2 folds) and b (1 fold))Explore Further: GXWeb Dragons, Folds and Fractions
Try the full GXWeb SpiroGraph construction
Explore Further: Create Your Own GXWeb SpiroGraph
Build Your Own Catalan Polygons
How many non-intersecting diagonals can be drawn for each polygon?Explore Further: GXWeb Catalan Playground
GXWeb Save and Share with QRCode (mp4 demo:3:02)
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: Exploring Alternate Forms