9801² − 29 × 1820² = 1, and √29 is where it came from

Pell's equation wants a square one more than D times another square, and for D = 29 the answer is huge.

Equations and algebra · Level: Classic result · Updated on 2026-11-10

Find whole numbers with x² − 29y² = 1 — a square that is exactly one more than 29 times another square. The smallest solution above the trivial x = 1 is x = 9801, y = 1820, and the first link prints the subtraction as 1. The second and third links are the two halves of it: 9.6059601⋅10+7 and 9.60596⋅10+7, which agree in their first six printed digits and differ by exactly one unit in the eighth place. The fourth link is √29 = 5.3851648071345, and the pair (9801, 1820) is a convergent of its continued fraction, which is not a coincidence but the method.

Lagrange's theorem is that the continued fraction of √D is periodic, and that the fundamental solution of x² − Dy² = 1 is read off at the end of a period. Which period matters: the continued fraction of √29 is 5; then the block 2, 1, 1, 2, 10 repeating, five terms long, an odd number — and for an odd period the end of the first period lands on −1, the convergent 70/13, and indeed 70² − 29 × 13² = −1, while the +1 solution waits for the end of the second, which is where 9801/1820 sits. When the period is long the solution is large, and D = 29 has a period long enough to surprise people who expect a small answer. Fermat made the same point into a challenge in 1657 by asking the English for the solution of x² − 61y² = 1; Brouncker answered with x = 1 766 319 049, which is what an eleven-term period costs. Once the fundamental solution exists, every power of x + y√D is another solution — which is exactly how (9801, 1820) was got from (70, 13) by squaring — so the equation has infinitely many and the hard part is only ever the first. This is also why the screens on the second and third links look like failures of arithmetic and are not: they are two integers that differ by one, printed by a machine that shows eight significant figures.

Answer

1

How to read it

The difference the equation demands. The second and third links are its two halves, and the fourth is the square root whose continued fraction produced the pair.

Source

the equation x² − Dy² = 1, named after John Pell through Euler's misattribution; solved in general by Lagrange in 1769 from the continued fraction of √D, and the D = 61 case is the one Bhāskara II produced with his chakravala cycle in the twelfth century

Work it in the calculator

These links open the right calculator with this problem's numbers already typed in. The line above is what the screen should show — check it yourself.

This is an independent third-party tool site. It is not affiliated with, sponsored by, or authorised by Casio, Texas Instruments or their distributors. Model names and product names are trademarks of their respective owners and appear here only to identify devices.

The keystroke sequences in these manuals were written from this site's own layout data — the same data the online calculator renders — plus publicly available product facts. Specifications and regional configurations are confirmed against the physical device and the manufacturer's most recent material.