What is a continued fraction?
Representing a number as a continued fraction
Converting a Continued Fraction to a Simple Fraction
Continued Fractions of Period 3
A longer table of continued fractions terms for square roots
Go to my home page.
Back in the second installment we expanded the square roots of several integers
into continued fractions.
First,
2, as a continued fraction, is:

which we can also write as
.
There is an obvious pattern in these terms.
The first term is 1 and all other terms are 2, and it is clear that this
will continue indefinitely since the decimal fraction in the final
denominator of each step is the same. How interesting. While the
continued fraction of
shows no pattern (and indeed has none), the
2,
which looks every bit as "irrational" as
when expressed as a
decimal number, has an extremely simple continued fraction.
We also expanded
14, 3.741657386774..., as a
continued fraction and found:
Here is another pattern: 1, 2, 1, 6 repeated over and over. As we will see, this is not a coincidence. It will be shown that the continued fraction for the square root of any integer has a repeating pattern. The number of terms in this pattern is interesting because it is predictable for the square root of some integers while it appears to be totally random for others. Look at the following table of details about the continued fraction expansion of the square roots of the first 60 integers.
|
The table at the left gives the first 60 numbers and details about the continued fraction expansion of their square roots. Specifically, N is the integer; the period, P, is the number of terms given in the rightmost column (Terms); n and m are numbers such that N = n² + m; and Terms are the terms in one period of the continued fraction of the square root of N. We present the values n and m because they will be useful in the following discussion and analysis.
The gray lines in the table are the perfect squares; since their square roots are whole numbers, they have no continued fraction expansion. A little review of the table shows some definite regularities and some seemingly random occurances. Some of the obvious patterns include:
|
Beyond these obvious patterns, there seems to be little rhyme or reason for the number of terms or their actual sequence. In fact, there is no general way to calculate P, the number of terms, for any given N. However, there are a few other points worth noting. First, almost all of the numbers have an even number of terms. The few with an odd number (greater than 1) are highlighted in yellow. Notice that the sequences are still palindromic, they just do not have a central term. 41 is the smallest number to have a continued fraction of period 3. As you can easily see, most of the terms are small numbers. The few entries highlighted in lavender (22, 31, 46, 59) each have a term equal to n at the center of the palindrome of terms. It can be shown that this is the largest that a term can be (except the last). Also, there is a maximum number of terms: 2n. This does happen very often, but notice that 46 is interesting because it has the maximun central term (6) and it also has 12 terms>) in its sequence
The case where the number of terms is 3 is intriging. The first 40 numbers with this property are:
| Numbers with continued fraction period of 3 | ||||
|---|---|---|---|---|
| 41 | 130 | 269 | 370 | 458 |
| 697 | 986 | 1313 | 1325 | 1613 |
| 1714 | 2153 | 2642 | 2834 | 3181 |
| 3770 | 4409 | 4778 | 4933 | 5098 |
| 5837 | 5954 | 6626 | 7465 | 7610 |
| 8354 | 9293 | 10282 | 10865 | 11257 |
| 11321 | 12410 | 13033 | 13549 | 14698 |
| 14738 | 15977 | 17266 | 17989 | 18605 |
The case of numbers which have n in the middle of their sequence, as highlighted in lavender in the table, is also curiously irregular. Technically, all numbers of the form N = n² + 2 meet this criterion (although they are not highlighted in the main table). The first 60 such numbers are (the "irregular" ones are highlighted in lavender, the ones of the form n² + 2 in yellow):
| Numbers with a maximum term in their series | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| 3 | 6 | 11 | 18 | 22 | 27 | 31 | 38 | 46 | 51 |
| 59 | 66 | 83 | 102 | 114 | 118 | 123 | 127 | 131 | 139 |
| 146 | 158 | 162 | 166 | 171 | 179 | 187 | 191 | 198 | 206 |
| 214 | 227 | 239 | 243 | 251 | 258 | 262 | 278 | 291 | 307 |
| 311 | 326 | 334 | 354 | 358 | 363 | 367 | 379 | 383 | 387 |
| 391 | 402 | 418 | 422 | 443 | 451 | 459 | 463 | 467 | 479 |
Finally, the case where P = 2n, the period of the terms is at its maximal length. There are only 35 such cases in the first 300,000 numbers.
| Numbers with maximum continued fraction periods | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| 3 | 7 | 46 | 919 | 1516 | |||||
| 1831 | 2311 | 3004 | 3259 | 3964 | |||||
| 4741 | 5839 | 22159 | 26086 | 28279 | |||||
| 39244 | 41836 | 42844 | 46174 | 46831 | |||||
| 59101 | 59854 | 67321 | 72724 | 81766 | |||||
| 81799 | 89881 | 114766 | 117811 | 123286 | |||||
| 239089 | 257461 | 262894 | 279679 | 287284 | |||||
Truly, something as comparatively simple as the continued fraction expansion of square roots of integers has many complex and erratic properties. Only a very few have been mentioned here.