A periodic continued fraction is a continued fraction whose terms eventually repeat from some point onwards. The minimal number of repeating terms is called the period of the continued fraction. The properties below concern infinite regular continued fractions. Every such continued fraction, periodic or otherwise, represents a unique irrational number, and each irrational number has a unique infinite regular continued fraction.
The square root of a positive integer
that is not a square number has a periodic continued
fraction of the form
|
(1)
|
(Rose 1994, p. 130), where and
is the floor function.
The repeating portion preceding
is symmetric upon reversal
and may be empty. When it is nonempty, its central term may appear either once or
twice.
For such ,
the partial denominators of the continued
fraction of
satisfy
|
(2)
|
for .
An irrational number has a periodic regular continued fraction iff it is a root
of a quadratic polynomial with integer
coefficients. A purely periodic tail of such an expansion satisfies a relation of the form
|
(3)
|
where ,
,
,
and
are integers and
. This yields a quadratic
equation for
and hence for the original irrational
number.
The periods of the continued fractions of the square roots of the first few nonsquare integers 2, 3, 5, 6, 7, 8, 10, 11, 12, 13, ... (OEIS A000037) are 1, 2, 1, 2, 4, 2, 1, 2, 2, 5, ... (OEIS A013943; Williams 1981, Jacobson et al. 1995). These numbers and their continued fraction representations are summarized in the following table.
| 2 | 22 | ||
| 3 | 23 | ||
| 5 | 24 | ||
| 6 | 26 | ||
| 7 | 27 | ||
| 8 | 28 | ||
| 10 | 29 | ||
| 11 | 30 | ||
| 12 | 31 | ||
| 13 | 32 | ||
| 14 | 33 | ||
| 15 | 34 | ||
| 17 | 35 | ||
| 18 | 37 | ||
| 19 | 38 | ||
| 20 | 39 | ||
| 21 | 40 |
An upper bound for the length of the period of is
. The least positive
s such that the continued
fraction of
has period
, 2, ... are 2, 3, 41, 7, 13, 19, 58, 31, 106, ... (OEIS
A013646). The first few values of
such that the continued
fraction of
has period
are summarized below for small
.
| OEIS | ||
| 1 | A002522 | 2, 5, 10, 17, 26, 37, 50, 65, 82, 101, ... |
| 2 | A013642 | 3, 6, 8, 11, 12, 15, 18, 20, 24, 27, ... |
| 3 | A013643 | 41, 130, 269, 370, 458, ... |
| 4 | A013644 | 7, 14, 23, 28, 32, 33, 34, 47, 55, 60, ... |
| 5 | A010337 | 13, 29, 53, 74, 85, 89, 125, 173, 185, 218, ... |
| 6 | A020347 | 19, 21, 22, 45, 52, 54, 57, 59, 70, 77, ... |
| 7 | A010338 | 58, 73, 202, 250, 274, 314, 349, 425, ... |
| 8 | A020348 | 31, 44, 69, 71, 91, 92, 108, 135, 153, 158, ... |
| 9 | A010339 | 106, 113, 137, 149, 265, 389, 493, ... |
| 10 | A020349 | 43, 67, 86, 93, 115, 116, 118, 129, 154, 159, ... |
Assigning period 0 to square numbers, the values of
at which the period of the continued fraction
of
reaches a new record are 1, 2, 3, 7, 13, 19, 31, 43, 46, 94, 139, 151, 166, 211,
331, 421, 526, 571, ... (OEIS A013645).
For positive integers ,
,
,
, and
, and an integer
, general identities for periodic continued fractions include
|
(4)
| |||
|
(5)
| |||
|
(6)
| |||
|
(7)
| |||
|
(8)
| |||
|
(9)
| |||
|
(10)
|
(Wall 1948, pp. 39 and 83). In each identity, is the convergent formed
from the first
terms of the displayed repeating block, with
and
.
The first follows from
|
(11)
| |||
|
(12)
|
Therefore,
|
(13)
|
so substituting into the defining expansion gives
|
(14)
|
Expanding
|
(15)
|
and solving using the quadratic formula gives
|
(16)
|
The analog of this treatment in the general case gives
|
(17)
|