History of Mathematics
in India IIT Gandhinagar, home

Explainer

Cakravāla

The cyclic method for x² − N y² = 1

sourceJayadeva, c. 1000 CE; Bhāskara II, Bījagaṇita, 1150

The square of an optional number, multiplied by a given number and then increased or decreased by another given number, is of the nature of a square.

Jayadeva’s definition of the vargaprakṛti, as quoted by Udayadivākara in 1073, in translation

What the problem is

Given a number N that is not a square, find whole numbers x and y with x² − N y² = 1. For N = 2 the smallest answer is 3 and 2; for N = 61 it is 1,766,319,049 and 226,153,980. Brahmagupta posed the problem in 628 CE and gave a way to combine two near-solutions into a better one, his bhāvanā. Jayadeva, and after him Bhāskara II in the Bījagaṇita of 1150, turned that into a complete method: the cakravāla, the cycle.

The instrument

Each row is a triple (a, b, k) with a² − N b² = k. Start with b = 1 and a the nearest whole number to √N. At every step choose a multiplier m so that (a + b m) is divisible by k and m² is as close to N as possible; then the next triple is

a′ = (a m + N b) ⁄ |k|, b′ = (a + b m) ⁄ |k|, k′ = (m² − N) ⁄ k.

Drag the step slider and watch k shrink. When it reaches 1 you have the answer. When it reaches −1, ±2 or ±4, Brahmagupta’s rules finish the job without further cycling: one composition for −1 and ±2, a short formula for ±4. The instrument applies them, and labels the row where it does.

Bhāskara’s example

Bhāskara chose N = 61, which happens to be the hardest case under a hundred. His own working takes a single step of the cycle, from (8, 1) with k = 3 to (39, 5) with k = −4, and then Brahmagupta’s rule for −4 gives the answer at once; that is what the instrument shows. Left to run without the shortcut, the cycle would reach k = −1 at (29,718, 3,805) after six steps and one composition would finish it. In 1657 Pierre de Fermat set the same N = 61 as a challenge to the mathematicians of Europe; Brouncker and Wallis answered it, and only Lagrange, in 1768, proved that a solution always exists.

Where it went

In 1929–30 A.A. Krishnaswami Ayyangar gave the first complete analysis of the cycle: that it always reaches a solution, and that it is a different and more economical process than the one Euler and Lagrange used. In papers of 1938–41 he showed that the cycle corresponds to a half-regular continued fraction of √N, which he named the nearest-square continued fraction, and not to the simple continued fraction that earlier writers had assumed. Brahmagupta’s composition rule is an early instance of the composition of binary quadratic forms that Gauss developed in 1801 and that Manjul Bhargava generalised two centuries later. Nārāyaṇa Paṇḍita’s Gaṇitakaumudī of 1356 gives the vargaprakṛti a chapter of its own; see the page on the Gaṇitakaumudī for the project’s new edition.

Sources