Continued Fractions for Square Roots
Summary: Lagrange (Additions II, Art. 41, Scholium) reproduces Euler’s table from the New Commentaries of Petersburg vol. XI, listing the eventually-periodic continued-fraction expansion of for every non-square from 2 to 99. These expansions are useful for solving Pell-type equations since their convergents are exactly the candidate solutions.
Sources: additions-2
Last updated: 2026-05-10
Form of the Expansion
Every (with a non-square positive integer) has a continued fraction of the form
where , the period is finite, and the inner block is a palindrome (reads the same forwards and backwards). The last partial quotient before the period closes is always .
This regularity follows from the periodicity theorem (periodicity-quadratic-irrationals) plus a symmetry argument on the conjugate root.
Table for
(Modern notation: . Period length is the number of overlined entries.)
| Period | ||
|---|---|---|
| 2 | 1 | |
| 3 | 2 | |
| 5 | 1 | |
| 6 | 2 | |
| 7 | 4 | |
| 8 | 2 | |
| 10 | 1 | |
| 11 | 2 | |
| 12 | 2 | |
| 13 | 5 | |
| 14 | 4 | |
| 15 | 2 | |
| 17 | 1 | |
| 18 | 2 | |
| 19 | 6 | |
| 20 | 2 | |
| 21 | 6 | |
| 22 | 6 | |
| 23 | 4 | |
| 24 | 2 | |
| 26 | 1 | |
| 27 | 2 | |
| 28 | 4 | |
| 29 | 5 | |
| 30 | 2 | |
| 31 | 8 | |
| 32 | 4 | |
| 33 | 4 | |
| 34 | 4 | |
| 35 | 2 | |
| 37 | 1 | |
| 38 | 2 | |
| 39 | 2 | |
| 40 | 2 | |
| 41 | 3 | |
| 42 | 2 | |
| 43 | 10 | |
| 44 | 8 | |
| 45 | 6 | |
| 46 | 12 | |
| 47 | 4 | |
| 48 | 2 | |
| 50 | 1 |
Notable Entries from the Full Table ()
| Period | ||
|---|---|---|
| 53 | 5 | |
| 58 | 7 | |
| 61 | 11 | |
| 67 | 10 | |
| 73 | 7 | |
| 76 | 12 | |
| 79 | 4 | |
| 89 | 5 | |
| 94 | 16 | |
| 97 | 11 |
The original table runs to . and are notable for unusually long periods relative to nearby .
Lagrange’s Original Layout (Art. 41)
Lagrange formats each entry as a two-row block (per his algorithm of Art. 33 — see binary-quadratic-forms):
- Upper row: — the values with sign flipped to alternate
- Lower row: — the partial quotients of
The lower row is the modern continued fraction. The upper row encodes the auxiliary data needed to detect the period and to compute at each convergent (since for ).
Sample reading for :
P: 1 1 1 1 ... → P^k = 1, -1, 1, -1, ... (period 1, ±1 alternating)
μ: 1 2 2 2 ... → √2 = [1; 2̄]
So the convergents of satisfy , alternating — exactly the Pell solutions for .
Period Length and Pell Solutions
For each non-square :
- If the period is even, then is never solvable; the minimal Pell solution to is given by the convergent at index .
- If the period is odd, then both and are solvable; the minimal -solution is at index , and the minimal -solution is at index .
From the table:
| Period | Solvable: ? | |
|---|---|---|
| 2 | 1 | yes |
| 3 | 2 | no |
| 5 | 1 | yes |
| 13 | 5 | yes |
| 19 | 6 | no |
| 29 | 5 | yes |
| 41 | 3 | yes |
| 61 | 11 | yes |
This gives a quick test for which admit : precisely those whose has odd CF period.
Convergents and Pell Solutions Compared with ch2.0.7-pell-equation-method
The table on pell-equation lists Euler’s minimal Pell solutions. These match exactly the convergents at the period boundary in Lagrange’s CF table:
| Lagrange CF index | Pell minimum | |
|---|---|---|
| 2 | 1 | (3, 2) at index 2 (since period odd, need 2r) — actually , ✓ |
| 3 | 2 | (2, 1): convergents , last is the answer |
| 5 | 1 | (9, 4) at index 2 |
| 7 | 4 | (8, 3): convergents ✓ |
| 13 | 5 (odd) | (649, 180) at index 10 |
| 29 | 5 (odd) | (9801, 1820) at index 10 |
| 61 | 11 (odd) | (1766319049, 226153980) at index 22 — explains the famously huge value |
The huge minimal Pell solution at is forced by its CF having period 11 (odd) with non-trivial coefficients — running the convergent recurrence 22 times yields the giant .
Reference
Euler’s original table appeared in Novi Commentarii Academiae Scientiarum Petropolitanae, vol. XI (1765), supplemented in his Mémoires de l’Académie de Berlin 1768. Lagrange reproduces it as a service to his readers — anticipating modern reference tables.
Related pages
- add2-arithmetic-problems — chapter context (Arts. 23–41)
- binary-quadratic-forms — the algorithm
- periodicity-quadratic-irrationals — why the CF must be periodic
- pell-equation — Pell solutions read off from the table
- continued-fractions — definition and basics
- convergents — the that solve Pell
- ch2.0.7-pell-equation-method — Euler’s iterative descent (alternative algorithm)