<<

Solving a Famous Problem The Chakrava-la Method Zeroing in on a Solution

Let be a non-square positive integer. The problem of �inding positive integers such that is one of enormous interest to number feature theorists.𝐧𝐧𝐧𝐧 This equation𝟐𝟐𝟐𝟐 is commonly𝟐𝟐𝟐𝟐 known today as ‘Pell’s equation’, so-named𝐱𝐱𝐱𝐱𝐱𝐱 after 𝐱𝐱𝐱𝐱 the English𝐱𝐱𝐱𝐱 −𝐧𝐧𝐧𝐧 scholar𝐱𝐱𝐱𝐱 =𝟏𝟏𝟏𝟏 John Pell (1611–1685). The name was given by Leonhard Euler (1707–1783), but we know now that this was done on an erroneous supposition. Before Pell and Euler, the equation had been explored by . And much before Fermat — a whole millennium earlier — the same equation had been studied in great detail by the Indian mathematician (598–670). The equation was referred to by Brahmagupta as the Varga Prakriti, or the “equation of the multiplied square”. Some centuries later came Jayadeva (950–1000) who delved deeper into the problem and offered a more general procedure for its solution. Bhāskarachārya II (1114–1185) re�ined this work and gave a full account of the in his important work, Bījaganitam. He gave the name Chakravāla to the algorithm� the name re�lects the cyclic or iterative nature of the procedure, for ‘Chakra’ means ‘wheel’. Narayana Pandit (1340–1400) added further to this work. The above equation could therefore be called the Brahmagupta-Jayadeva-Bhāskarā equation, but we shall call it simply the Brahmagupta equation. In this note we explain the working of the Chakravāla algorithm to solve this equation. However, we do not give a proof that the algorithm works. For that we shall only refer you to published sources.

Shailesh Shirali Introduction.

Perhaps you have come across the ‘house-numberOn a street with puzzle’: houses numbered , , , …, where is a three-digit number, I live in a house, numbered , such that the sums of the house numbers on the two1 2 sides3 of𝐴𝐴𝐴𝐴 my house𝐴𝐴𝐴𝐴 are equal. Find and . 𝐵𝐵𝐵𝐵

𝐴𝐴𝐴𝐴 𝐵𝐵𝐵𝐵

We can ask, more generally: “Find possible values of 𝐴𝐴𝐴𝐴 and 𝐵𝐵𝐵𝐵” (without the condition that 𝐴𝐴𝐴𝐴 is a three-digit number). The 13 At Right Angles | Vol. 3, No. 3, November 2014 condition tells us that the sums 1+2+⋯+(𝐵𝐵𝐵𝐵−1𝐵𝐵 and Vol. 3, No. 3, November 2014 | At Right Angles 13 Brahmagupta’s identity.

(𝐵𝐵𝐵𝐵 𝐵𝐵𝐵𝐵𝐵𝐵 (𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵are equal. Hence: Somewhat more general are the following identities which were �irst discovered by Brahmagupta and used extensively by him: (𝐵𝐵𝐵𝐵 𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵 𝐵𝐵𝐵𝐵�𝐵𝐵𝐵𝐵 𝐵𝐵𝐵𝐵𝐵𝐵 𝐵𝐵𝐵𝐵(𝐵𝐵𝐵𝐵 𝐵𝐵𝐵𝐵𝐵𝐵 � 𝐵𝐵𝐵𝐵�𝐵𝐵𝐵𝐵 𝐵𝐵𝐵𝐵𝐵𝐵 = 𝐵𝐵 , ∴𝐵𝐵𝐵𝐵 = . � � � � � � 𝐵𝐵 𝐵𝐵 𝐵𝐵 𝐵𝐵 �𝑛𝑛𝑛𝑛 − 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 � �𝑛𝑛𝑛𝑛 − 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 �𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛−𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 , � � � � � � � (2) � � � � �or each �ixed integer�𝑛𝑛𝑛𝑛 ,− the 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 set��𝑛𝑛𝑛𝑛 of integers− 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 �𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 expressible�𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 as − 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛is− closed𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 under. multiplication From the last relation we get: 8𝐵𝐵𝐵𝐵 =4𝐵𝐵𝐵𝐵 𝐵𝐵 4𝐵𝐵𝐵𝐵, hence 8𝐵𝐵𝐵𝐵 𝐵𝐵𝐵𝐵=(𝐵𝐵𝐵𝐵𝐵𝐵 𝐵𝐵𝐵𝐵𝐵𝐵 . Let 𝑥𝑥𝑥𝑥 = 𝐵𝐵𝐵𝐵𝐵𝐵 𝐵𝐵 and 𝑦𝑦𝑦𝑦 = 𝐵𝐵𝐵𝐵𝐵𝐵. � � Then we have: � � Thus: 𝑛𝑛𝑛𝑛 � � � 𝑥𝑥𝑥𝑥 �− 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 � �. 𝑥𝑥𝑥𝑥 𝐵𝐵𝐵𝐵𝑦𝑦𝑦𝑦 = 𝐵𝐵. Example: Let 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛. The integers 3 −�𝑛𝑛 ×1 𝑛𝑛 7�and 5 − 𝑛𝑛 × 𝑛𝑛 𝑛𝑛 17 are both of the form 𝑥𝑥𝑥𝑥 − 𝑛𝑛𝑛𝑛𝑛𝑛 , and so is their product 7×17𝑛𝑛 119 𝑛𝑛 19 − 𝑛𝑛 × 11 . Thus the house-number puzzle has given rise to a Brahmagupta equation with 𝑛𝑛𝑛𝑛 =𝐵𝐵. This is one of several different ways in which we arrive at such equations. The case 𝑛𝑛𝑛𝑛𝑛𝑛−1 corresponds to the Diophantus-Brahmagupta-Fibonacci identity. As we have a single equation in two variables, there could be more than one solution. (There could also be As earlier, it is easy to verify these relations by expanding all the terms. And it is easy to reconstruct them no solutions.) �s there a systematic way of �inding the solutions? This question was considered by by studying numbers of the form 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛√𝑛𝑛𝑛𝑛, as can be seen by multiplying together two numbers of this Brahmagupta. He solved the problem for some individual values of 𝑛𝑛𝑛𝑛, e.g., 𝑛𝑛𝑛𝑛 =8𝑛𝑛 and 𝑛𝑛𝑛𝑛 = 𝑛𝑛𝐵𝐵 and went on form. For we have: to say: “A person who is able to solve these problems within a year is truly a mathematician!” A year? �𝑛𝑛𝑛𝑛 𝑛𝑛𝑛𝑛𝑛𝑛√𝑛𝑛𝑛𝑛�𝑛𝑛�𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛√𝑛𝑛𝑛𝑛�𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛√𝑛𝑛𝑛𝑛. (3) � � Brahmagupta clearly had a high regard for the problem! Brahmagupta used (2) in his approach to the equation 𝑥𝑥𝑥𝑥 − 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 𝑛𝑛 1. Indeed, he used it as a sort of Three identities ‘composition law’ which has a very modern look about it, for it looks like it is taken straight out of a book on modern ! In using such an approach, Brahmagupta was ahead of his time by a whole millennium. Suppose that is a solution of the equation , and is a solution of Therethe equation is another way of expressing. Then the identity which may� bringis� a home solution its of signi�icance the equation more strongly. . Diophantus-Brahmagupta-Fibonacci identity. � We start by some identities which were used with great effectiveness by the main actors in this story. 𝑛𝑛�𝑥𝑥𝑥𝑥,𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛� �𝑛𝑛𝑛𝑛𝑛𝑛 𝑥𝑥𝑥𝑥 − 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 𝑛𝑛 𝑘𝑘𝑘𝑘 𝑛𝑛𝑥𝑥𝑥𝑥, 𝑛𝑛𝑛𝑛𝑛𝑛 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛� 𝑛𝑛𝑛𝑛𝑛𝑛 � � Arithmetica Remark. 𝑥𝑥𝑥𝑥 −𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 𝑛𝑛 𝑘𝑘𝑘𝑘� 𝑛𝑛𝑥𝑥𝑥𝑥, 𝑛𝑛𝑛𝑛𝑛𝑛 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛� 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 𝑥𝑥𝑥𝑥 −𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 𝑛𝑛 𝑘𝑘𝑘𝑘�𝑘𝑘𝑘𝑘� The following two identities go back all the way to Diophantus of Alexandria (they are found in his book ): The appearanceBrahma-Sphuta-Siddhantha of the identical identity in the works of Fibonacci (1170–1250) and � � � � � � Brahmagupta may seem an amazing coincidence but it is not a mystery. Brahmagupta wrote an extremely �𝑎𝑎𝑎𝑎 𝐵𝐵 𝑏𝑏𝑏𝑏 � �𝑎𝑎𝑎𝑎 𝐵𝐵 𝑑𝑑𝑑𝑑 �=(𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝐵𝐵 (𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎 𝐵𝐵 𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵 , � � � � � � � (1) important work, the , which reached the centre of the Arab world (Baghdad) �𝑎𝑎𝑎𝑎 𝐵𝐵 𝑏𝑏𝑏𝑏 � �𝑎𝑎𝑎𝑎 𝐵𝐵 𝑑𝑑𝑑𝑑 �=(𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝐵𝐵 (𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎 𝐵𝐵 𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵the𝐵𝐵 . product of two integers, in the eighth century and was translated into Arabic, at the instance of the Caliph. Three centuries later each a sum of two squares, is itself a sum of two squares, and in two different ways this work was translated into Latin in Spain, and it is this doubly translated work that came into the hands The identities may be veri�ied by expanding all the terms. They tell us that ofBhāskarā’s Fibonacci, lemma. who was then a trader in Italy. � � � � . For example, consider the two integers 𝐵𝐵0=𝑛𝑛 𝐵𝐵𝐵𝐵 and 4𝐵𝐵 =5 𝐵𝐵 4 ; both are sums of two squares. Their product The third identity in our list is the following, which is an auxiliary result needed by 𝐵𝐵0×4𝐵𝐵 =4𝐵𝐵0 may be written in two such ways: the Chakravāla algorithm: � � � � � � � � � 𝑚𝑚𝑚𝑚𝑛𝑛𝑛𝑛 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 𝑛𝑛𝑛𝑛 𝑛𝑛𝑛𝑛𝑛𝑛 𝑚𝑚𝑚𝑚 −𝑛𝑛𝑛𝑛 4𝐵𝐵0=(𝐵𝐵5 𝐵𝐵 4𝐵𝐵 𝐵𝐵 (𝐵𝐵𝐵𝐵 𝐵𝐵 5𝐵𝐵 = 𝐵𝐵𝐵𝐵 𝐵𝐵 7 , If 𝑛𝑛𝑛𝑛 − 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 𝑛𝑛 𝑘𝑘𝑘𝑘, then � � −𝑛𝑛𝑛𝑛� � 𝑛𝑛 . (4) � � � � 𝑘𝑘𝑘𝑘 𝑘𝑘𝑘𝑘 𝑘𝑘𝑘𝑘 closure4𝐵𝐵0=( result𝐵𝐵5 𝐵𝐵 4𝐵𝐵 𝐵𝐵The(𝐵𝐵𝐵𝐵 set 𝐵𝐵 5 of𝐵𝐵 integers= 𝐵𝐵𝐵𝐵 𝐵𝐵𝐵𝐵 expressible7 . as a sum of two squares is The veri�ication is straightforward: closed under multiplication � � Today we describe this as a . We say: � � � � � � � 𝑚𝑚𝑚𝑚𝑛𝑛𝑛𝑛 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 𝑛𝑛𝑛𝑛 𝑛𝑛𝑛𝑛𝑛𝑛 𝑚𝑚𝑚𝑚 𝑛𝑛𝑛𝑛 𝑛𝑛 𝑛𝑛𝑛𝑛 𝑛𝑛𝑛𝑛 𝑛𝑛𝑛𝑛𝑚𝑚𝑚𝑚𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 � 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 −𝑛𝑛𝑛𝑛𝑚𝑚𝑚𝑚 𝑛𝑛𝑛𝑛 − 𝑛𝑛𝑚𝑚𝑚𝑚𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 . � � −𝑛𝑛𝑛𝑛� � 𝑛𝑛 � The 𝑘𝑘𝑘𝑘 𝑘𝑘𝑘𝑘 𝑘𝑘𝑘𝑘 How the early mathematicians hit upon this double identity is not clear, but it is easy for us today to � � � � � � � magnitude of the product of two complex numbers is equal to the product of their magnitudes 𝑚𝑚𝑚𝑚 𝑛𝑛𝑛𝑛 𝑛𝑛 𝑛𝑛𝑛𝑛 𝑛𝑛𝑛𝑛 − 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 −𝑛𝑛𝑛𝑛𝑚𝑚𝑚𝑚 𝑛𝑛𝑛𝑛 reconstruct it and also to remember it by invoking the following result about complex numbers: 𝑛𝑛 � 𝑘𝑘𝑘𝑘 . For, consider � � � � 𝑛𝑛𝑚𝑚𝑚𝑚 −𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 − 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 𝑛𝑛 𝑚𝑚𝑚𝑚 −𝑛𝑛𝑛𝑛 the complex numbers 𝑎𝑎𝑎𝑎 𝐵𝐵𝐵𝐵𝐵𝐵𝑎𝑎𝑎𝑎 and 𝑎𝑎𝑎𝑎 𝐵𝐵 𝑑𝑑𝑑𝑑𝑎𝑎𝑎𝑎. Here 𝑎𝑎𝑎𝑎, 𝑏𝑏𝑏𝑏� 𝑎𝑎𝑎𝑎,𝑑𝑑𝑑𝑑are real numbers, and 𝑎𝑎𝑎𝑎�√𝐵𝐵𝐵𝐵. Now, observing that 𝑛𝑛 � 𝑛𝑛 . � � � � The Chakravāla 𝑘𝑘𝑘𝑘 𝑘𝑘𝑘𝑘 |𝑎𝑎𝑎𝑎 𝐵𝐵𝐵𝐵𝐵𝐵𝑎𝑎𝑎𝑎| =𝑎𝑎𝑎𝑎 𝐵𝐵 𝑏𝑏𝑏𝑏 = |𝑎𝑎𝑎𝑎 𝐵𝐵𝐵𝐵𝐵𝐵𝑎𝑎𝑎𝑎| , � � � � |𝑎𝑎𝑎𝑎 𝐵𝐵 𝑑𝑑𝑑𝑑𝑎𝑎𝑎𝑎� = 𝑎𝑎𝑎𝑎 𝐵𝐵 𝑑𝑑𝑑𝑑 =|𝑎𝑎𝑎𝑎 𝐵𝐵 𝑑𝑑𝑑𝑑𝑎𝑎𝑎𝑎� , In the description given below, 𝑛𝑛𝑛𝑛 is a �ixed non-square positive integer. For convenience we use the (𝑎𝑎𝑎𝑎 𝐵𝐵𝐵𝐵𝐵𝐵𝑎𝑎𝑎𝑎𝐵𝐵�𝑎𝑎𝑎𝑎 𝐵𝐵𝐵𝐵𝐵𝐵𝑎𝑎𝑎𝑎𝐵𝐵𝐵𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎 𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵�𝑎𝑎𝑎𝑎𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑎𝑎𝑎𝑎𝐵𝐵𝑎𝑎𝑎𝑎, symbol or triple [𝑥𝑥𝑥𝑥,𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛�𝑥𝑥 to indicate that the numbers 𝑥𝑥𝑥𝑥, 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 satisfy the relation � � (𝑎𝑎𝑎𝑎 𝐵𝐵𝐵𝐵𝐵𝐵𝑎𝑎𝑎𝑎𝐵𝐵�𝑎𝑎𝑎𝑎 𝐵𝐵𝐵𝐵𝐵𝐵𝑎𝑎𝑎𝑎𝐵𝐵𝐵𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎 𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵�𝑎𝑎𝑎𝑎𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑎𝑎𝑎𝑎𝐵𝐵𝑎𝑎𝑎𝑎, 𝑥𝑥𝑥𝑥 − 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 𝑛𝑛 𝑘𝑘𝑘𝑘. (5)

we see how the Diophantus-Brahmagupta-Fibonacci identity is equivalent to the statement “magnitude of Observe that 𝑛𝑛𝑛𝑛 does not appear in the triple. This is so because 𝑛𝑛𝑛𝑛 is treated as a �ixed integer in these product equals product of magnitudes” for complex numbers. relations.

1514 At Right Angles | Vol. 3, No. 3, November 2014 Vol. 3, No. 3, November 2014 | At Right Angles 1514 2 At Right Angles ∣ Vol. 3, No. 3, November 2014 Vol. 3, No. 3, November 2014 ∣ At Right Angles 3 Brahmagupta’s identity.

Somewhat more general are the following identities which were �irst discovered by Brahmagupta and used extensively by him: � � � � � � �𝑛𝑛𝑛𝑛 − 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 � �𝑛𝑛𝑛𝑛 − 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 �𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛−𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 , � � � � � � � (2) �or each �ixed integer�𝑛𝑛𝑛𝑛 ,− the 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 set��𝑛𝑛𝑛𝑛 of integers− 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 �𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 expressible�𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 as − 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛is− closed𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 under. multiplication � � Thus: 𝑛𝑛𝑛𝑛 � � � 𝑥𝑥𝑥𝑥 �− 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 � �. Example: Let 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛. The integers 3 −�𝑛𝑛 ×1 𝑛𝑛 7�and 5 − 𝑛𝑛 × 𝑛𝑛 𝑛𝑛 17 are both of the form 𝑥𝑥𝑥𝑥 − 𝑛𝑛𝑛𝑛𝑛𝑛 , and so is their product 7×17𝑛𝑛 119 𝑛𝑛 19 − 𝑛𝑛 × 11 . The case 𝑛𝑛𝑛𝑛𝑛𝑛−1 corresponds to the Diophantus-Brahmagupta-Fibonacci identity. As earlier, it is easy to verify these relations by expanding all the terms. And it is easy to reconstruct them by studying numbers of the form 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛√𝑛𝑛𝑛𝑛, as can be seen by multiplying together two numbers of this form. For we have: �𝑛𝑛𝑛𝑛 𝑛𝑛𝑛𝑛𝑛𝑛√𝑛𝑛𝑛𝑛�𝑛𝑛�𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛√𝑛𝑛𝑛𝑛�𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛√𝑛𝑛𝑛𝑛. (3) � � Brahmagupta used (2) in his approach to the equation 𝑥𝑥𝑥𝑥 − 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 𝑛𝑛 1. Indeed, he used it as a sort of ‘composition law’ which has a very modern look about it, for it looks like it is taken straight out of a book on modern algebra! In using such an approach, Brahmagupta was ahead of his time by a whole millennium. Suppose that is a solution of the equation , and is a solution of Therethe equation is another way of expressing. Then the identity which may� bringis� a home solution its of signi�icance the equation more strongly. . � 𝑛𝑛�𝑥𝑥𝑥𝑥,𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛� �𝑛𝑛𝑛𝑛𝑛𝑛 𝑥𝑥𝑥𝑥 − 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 𝑛𝑛 𝑘𝑘𝑘𝑘 𝑛𝑛𝑥𝑥𝑥𝑥, 𝑛𝑛𝑛𝑛𝑛𝑛 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛� 𝑛𝑛𝑛𝑛𝑛𝑛 � � Remark. 𝑥𝑥𝑥𝑥 −𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 𝑛𝑛 𝑘𝑘𝑘𝑘� 𝑛𝑛𝑥𝑥𝑥𝑥, 𝑛𝑛𝑛𝑛𝑛𝑛 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛� 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 𝑥𝑥𝑥𝑥 −𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 𝑛𝑛 𝑘𝑘𝑘𝑘�𝑘𝑘𝑘𝑘�

The appearanceBrahma-Sphuta-Siddhantha of the identical identity in the works of Fibonacci (1170–1250) and Brahmagupta may seem an amazing coincidence but it is not a mystery. Brahmagupta wrote an extremely important work, the , which reached the centre of the Arab world (Baghdad) in the eighth century and was translated into Arabic, at the instance of the Caliph. Three centuries later this work was translated into Latin in Spain, and it is this doubly translated work that came into the hands ofBhāskarā’s Fibonacci, lemma. who was then a trader in Italy. The third identity in our list is the following, which is an auxiliary result needed by the Chakravāla algorithm: � � � � � 𝑚𝑚𝑚𝑚𝑛𝑛𝑛𝑛 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 𝑛𝑛𝑛𝑛 𝑛𝑛𝑛𝑛𝑛𝑛 𝑚𝑚𝑚𝑚 −𝑛𝑛𝑛𝑛 If 𝑛𝑛𝑛𝑛 − 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 𝑛𝑛 𝑘𝑘𝑘𝑘, then � � −𝑛𝑛𝑛𝑛� � 𝑛𝑛 . (4) 𝑘𝑘𝑘𝑘 𝑘𝑘𝑘𝑘 𝑘𝑘𝑘𝑘 The veri�ication is straightforward: � � � � � � � � � 𝑚𝑚𝑚𝑚𝑛𝑛𝑛𝑛 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 𝑛𝑛𝑛𝑛 𝑛𝑛𝑛𝑛𝑛𝑛 𝑚𝑚𝑚𝑚 𝑛𝑛𝑛𝑛 𝑛𝑛 𝑛𝑛𝑛𝑛 𝑛𝑛𝑛𝑛 𝑛𝑛𝑛𝑛𝑚𝑚𝑚𝑚𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 � 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 −𝑛𝑛𝑛𝑛𝑚𝑚𝑚𝑚 𝑛𝑛𝑛𝑛 − 𝑛𝑛𝑚𝑚𝑚𝑚𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 � � −𝑛𝑛𝑛𝑛� � 𝑛𝑛 � 𝑘𝑘𝑘𝑘 𝑘𝑘𝑘𝑘 𝑘𝑘𝑘𝑘 � � � � � � � 𝑚𝑚𝑚𝑚 𝑛𝑛𝑛𝑛 𝑛𝑛 𝑛𝑛𝑛𝑛 𝑛𝑛𝑛𝑛 − 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 −𝑛𝑛𝑛𝑛𝑚𝑚𝑚𝑚 𝑛𝑛𝑛𝑛 𝑛𝑛 � 𝑘𝑘𝑘𝑘 � � � � 𝑛𝑛𝑚𝑚𝑚𝑚 −𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 − 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 𝑛𝑛 𝑚𝑚𝑚𝑚 −𝑛𝑛𝑛𝑛 𝑛𝑛 � 𝑛𝑛 . The Chakravāla 𝑘𝑘𝑘𝑘 𝑘𝑘𝑘𝑘

In the description given below, 𝑛𝑛𝑛𝑛 is a �ixed non-square positive integer. For convenience we use the symbol or triple [𝑥𝑥𝑥𝑥,𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛�𝑥𝑥 to indicate that the numbers 𝑥𝑥𝑥𝑥, 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 satisfy the relation � � 𝑥𝑥𝑥𝑥 − 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 𝑛𝑛 𝑘𝑘𝑘𝑘. (5)

Observe that 𝑛𝑛𝑛𝑛 does not appear in the triple. This is so because 𝑛𝑛𝑛𝑛 is treated as a �ixed integer in these relations.

15 At Right Angles | Vol. 3, No. 3, November 2014 Vol. 3, No. 3, November 2014 | At Right Angles 15 Vol. 3, No. 3, November 2014 ∣ At Right Angles 3 The Brahmagupta identity (2) shows that from two triples [𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎�] and [𝑐𝑐𝑐𝑐𝑎𝑎 𝑐𝑐𝑐𝑐𝑎𝑎𝑎𝑎𝑎𝑎�] we can produce a third The ‘cycle’ tells us why Bhāskarā called this the Chakravāla. We show the working of the algorithm using a triple [𝑢𝑢𝑢𝑢𝑎𝑎 𝑢𝑢𝑢𝑢𝑎𝑎𝑎𝑎𝑎𝑎�𝑎𝑎𝑎𝑎�], with fewExample examples. 1. 𝑢𝑢𝑢𝑢𝑢𝑢𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎 𝑢𝑢𝑢𝑢𝑢𝑢𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎 𝑢𝑢𝑢𝑢𝑢𝑢𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎 𝑢𝑢 𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑢𝑢 (6) � �Let 𝑛𝑛𝑛𝑛 𝑛𝑛𝑛𝑛𝑛𝑛. Let us start with the trivial triple [4, 𝑛𝑛, 6], that is, with the relation Example: Take 𝑢𝑢𝑢𝑢𝑢𝑢𝑛𝑛𝑛𝑛. We have the triples [7𝑎𝑎 2𝑎𝑎 9] and [𝑛𝑛𝑛𝑛𝑛𝑛 3𝑎𝑎 3𝑛𝑛] which correspond to the relations 4Step− 𝑛𝑛𝑛𝑛 0: × 𝑛𝑛 𝑛𝑛 6, and see where it leads us. � � � � 7 − 𝑛𝑛𝑛𝑛 ×2 𝑢𝑢 9𝑎𝑎 𝑎𝑎𝑎𝑎 − 𝑛𝑛𝑛𝑛 ×3 𝑢𝑢 3𝑛𝑛𝑛𝑛 Step 1: [𝑎𝑎𝑎𝑎, 𝑎𝑎𝑎𝑎, 𝑎𝑎𝑎𝑎] 𝑛𝑛 𝑛� 𝑛𝑛𝑛𝑛. We seek a triple of the form [𝑢𝑢𝑢𝑢𝑎𝑎 𝑢𝑢𝑢𝑢𝑎𝑎 𝑎𝑎𝑎𝑎𝑎 𝑢𝑢 [𝑢𝑢𝑢𝑢𝑎𝑎 𝑢𝑢𝑢𝑢𝑎𝑎 𝑎𝑎. We get: 𝑢𝑢𝑢𝑢𝑢𝑢77 𝑢𝑢 𝑛𝑛𝑛𝑛 � 𝑢𝑢𝑢𝑢𝑛𝑛𝑛 and We want 𝑎𝑎𝑎𝑎 𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎 to� be divisible by 𝑎𝑎𝑎𝑎, i.e., 4 𝑎𝑎𝑎𝑎𝑎𝑎to be divisible by 6. Hence 𝑎𝑎𝑎𝑎 𝑚𝑚 𝑚𝑚𝑚𝑚, 𝑚𝑚, 𝑛𝑛𝑛 𝑚𝑚𝑛𝑛� 𝑚𝑚𝑚𝑚. 𝑢𝑢𝑢𝑢 𝑢𝑢 𝑢𝑢� 𝑢𝑢 𝑢 𝑢𝑢 𝑣𝑣3. Check: The value of 𝑎𝑎𝑎𝑎 for which 𝑎𝑎𝑎𝑎 − 𝑛𝑛𝑛𝑛 is least is 𝑎𝑎𝑎𝑎𝑎𝑎𝑚𝑚. � � Step 2: 𝑛𝑛37 − 𝑛𝑛𝑛𝑛 × 𝑣𝑣3 𝑢𝑢𝑢𝑢87𝑢𝑢9−𝑛𝑛𝑛𝑛 × 𝑛𝑛8𝑣𝑣9 𝑢𝑢 279𝑢𝑢 � 𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚 � 4 𝑎𝑎𝑎𝑎 � 4−𝑛𝑛𝑛𝑛 𝑎𝑎𝑎𝑎 𝑛𝑛 𝑛𝑛 3, 𝑎𝑎𝑎𝑎 𝑛𝑛 𝑛𝑛𝑛𝑛and 𝑎𝑎𝑎𝑎 𝑛𝑛 𝑛𝑛 −𝑛𝑛. |6| |6| 6 The composition law Samasa bhāvanā[𝑎𝑎𝑎𝑎𝑎𝑎 𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎�]⋆[𝑐𝑐𝑐𝑐𝑎𝑎 𝑐𝑐𝑐𝑐𝑎𝑎𝑎𝑎𝑎𝑎�]∶𝑢𝑢 [𝑎𝑎𝑎𝑎𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑎𝑎𝑎𝑎𝑐𝑐𝑐𝑐𝑎𝑎𝑎𝑎𝑎𝑎Bhavana𝑐𝑐𝑐𝑐𝑐𝑐𝑎𝑎𝑎𝑎𝑐𝑐𝑐𝑐𝑎𝑎𝑎𝑎𝑎𝑎�𝑎𝑎𝑎𝑎�] (7) StepWe have 1: obtained the triple [𝑎𝑎𝑎𝑎, 𝑎𝑎𝑎𝑎, 𝑎𝑎𝑎𝑎] 𝑛𝑛 𝑛� 𝑛𝑛𝑛�𝑛𝑛�. Since the third coordinate is not 𝑛𝑛, we go back to Step 1. � wasDeriving given Bhāskarā’s the name lemma from theby composition Brahmagupta law. (or just for short). We want 3 𝑎𝑎𝑎𝑎𝑎𝑎to be divisible by −𝑛𝑛. Any integer value will do. We also want |𝑎𝑎𝑎𝑎 − 𝑛𝑛𝑛𝑛| to be as Bhāskarā’s lemma stated above may look Stepsmall 2: as possible. So we choose 𝑎𝑎𝑎𝑎𝑎𝑎�. mysterious and unmotivated; but it looks more meaningful when we invoke the composition law. Say we � 9 𝑎𝑎 𝑎𝑎𝑎𝑎 � 3 𝑎𝑎 3 � 9−𝑛𝑛𝑛𝑛 � � 𝑎𝑎𝑎𝑎 𝑛𝑛 𝑛𝑛𝑛𝑛9, 𝑎𝑎𝑎𝑎 𝑛𝑛 𝑛𝑛 6 and 𝑎𝑎𝑎𝑎 𝑛𝑛 𝑛𝑛𝑛𝑛. have a triple� [𝑎𝑎𝑎𝑎𝑎𝑎 𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎]; that is, we have 𝑎𝑎𝑎𝑎 − 𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢 𝑢𝑢𝑢𝑢𝑢𝑢. For any integer 𝑚𝑚𝑚𝑚, we also have the ‘trivial triple’ |−𝑛𝑛| |−𝑛𝑛| −𝑛𝑛 [𝑚𝑚𝑚𝑚𝑎𝑎 𝑎𝑎𝑎𝑎 𝑚𝑚𝑚𝑚 − 𝑢𝑢𝑢𝑢� whose second coordinate is 𝑛𝑛; it corresponds to the trivial statement � � � We have obtained the triple [𝑎𝑎𝑎𝑎, 𝑎𝑎𝑎𝑎, 𝑎𝑎𝑎𝑎] 𝑛𝑛 �𝑛𝑛𝑛𝑛� 𝑛𝑛�. Now the third coordinate is 𝑛𝑛, so the computations are (𝑚𝑚𝑚𝑚𝑚𝑚 − 𝑢𝑢𝑢𝑢 𝑛𝑛𝑛𝑛 𝑢𝑢 𝑚𝑚𝑚𝑚 − 𝑢𝑢𝑢𝑢. Now let us compose these two triples using the Bhavana. We get: � � over, and we have obtained a solution to the problem: [𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎] ⋆ [𝑚𝑚𝑚𝑚𝑎𝑎 𝑛𝑛𝑎𝑎 𝑚𝑚𝑚𝑚 − 𝑢𝑢𝑢𝑢� 𝑢𝑢 𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢� 𝑢𝑢 𝑢𝑢𝑢𝑢𝑎𝑎𝑎𝑎𝑎𝑎 𝑎𝑎𝑎𝑎 𝑢𝑢 𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢 − 𝑢𝑢𝑢𝑢𝑢𝑢�𝑢𝑢 (8) � � � � Example 2. 𝑛𝑛9 − 𝑛𝑛𝑛𝑛 ×6 𝑛𝑛𝑛𝑛. In other words we have: if 𝑎𝑎𝑎𝑎 − 𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢 𝑢𝑢𝑢𝑢𝑢𝑢, then � � � � � Step 0: Let 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛3. We start with the trivial triple [4, 𝑛𝑛, 3], that is, with the relation 4 − 𝑛𝑛3×𝑛𝑛 𝑛𝑛 3. (𝑚𝑚𝑚𝑚𝑎𝑎𝑎𝑎 𝑢𝑢 𝑢𝑢𝑢𝑢𝑎𝑎𝑎𝑎𝑚𝑚 − 𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢� 𝑢𝑢 𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢 𝑢𝑢 𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢� − 𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢 (9) � Step 1: [𝑎𝑎𝑎𝑎, 𝑎𝑎𝑎𝑎, 𝑎𝑎𝑎𝑎] 𝑛𝑛 𝑛� 𝑛𝑛𝑛𝑛. Dividing through by 𝑎𝑎𝑎𝑎 we get Bhāskarā’s lemma: � � � We want 𝑎𝑎𝑎𝑎 𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎 to be divisible by 𝑎𝑎𝑎𝑎, i.e., 4 𝑎𝑎𝑎𝑎𝑎𝑎to be divisible by 3. Hence 𝑎𝑎𝑎𝑎 𝑚𝑚 𝑚𝑚𝑚𝑚, 𝑚𝑚, 𝑚𝑚, 𝑛𝑛𝑛𝑛� 𝑚𝑚𝑚𝑚. The 𝑚𝑚𝑚𝑚𝑎𝑎𝑎𝑎 𝑢𝑢 𝑢𝑢𝑢𝑢𝑎𝑎𝑎𝑎 𝑎𝑎𝑎𝑎 𝑢𝑢 𝑎𝑎𝑎𝑎𝑚𝑚𝑚𝑚 𝑚𝑚𝑚𝑚 − 𝑢𝑢𝑢𝑢 � � � −𝑢𝑢𝑢𝑢� � 𝑢𝑢 𝑢𝑢 (10) Stepvalue 2: of 𝑎𝑎𝑎𝑎 for which 𝑎𝑎𝑎𝑎 − 𝑛𝑛3 is least is 𝑎𝑎𝑎𝑎𝑎𝑎𝑚𝑚. 𝑎𝑎𝑎𝑎 𝑎𝑎𝑎𝑎 𝑎𝑎𝑎𝑎 Heuristic motivation for the Chakravāla. � 𝑚𝑚𝑚𝑚𝑚𝑚3 � 4 𝑎𝑎𝑎𝑎 � 4−𝑛𝑛3 � � 𝑎𝑎𝑎𝑎 𝑛𝑛 𝑛𝑛 7, 𝑎𝑎𝑎𝑎 𝑛𝑛 𝑛𝑛𝑛𝑛and 𝑎𝑎𝑎𝑎 𝑛𝑛 𝑛𝑛 −3. We seek to solve the equation 𝑥𝑥𝑥𝑥 − 𝑢𝑢𝑢𝑢𝑛𝑛𝑛𝑛 𝑢𝑢𝑢𝑢; that is, we seek a |3| |3| 3 triple [𝑥𝑥𝑥𝑥𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎�whose third coordinate is 𝑛𝑛, which is the smallest it can possibly be (it can never be 𝑛𝑛, StepWe have 1: obtained the triple [𝑎𝑎𝑎𝑎, 𝑎𝑎𝑎𝑎, 𝑎𝑎𝑎𝑎] 𝑛𝑛 𝑛𝑛𝑛𝑛𝑛𝑛�. As the third coordinate is not 𝑛𝑛, we go back to Step 1. because 𝑢𝑢𝑢𝑢 is non-square, implying that √𝑢𝑢𝑢𝑢 is irrational). Now when we repeatedly apply the composition law, the number in the third coordinate steadily increases, for it is subject to integer multiplication, and � We want 7 𝑎𝑎 𝑎𝑎𝑎𝑎𝑎𝑎 to be divisible by −3. Hence 𝑎𝑎𝑎𝑎 𝑚𝑚𝑚𝑚𝑛𝑛𝑛𝑛𝑛� 𝑛𝑛𝑛𝑛� 𝑚𝑚𝑚𝑚. The value of 𝑎𝑎𝑎𝑎 for which |𝑎𝑎𝑎𝑎 − 𝑛𝑛3| is least is 𝑎𝑎𝑎𝑎𝑎𝑎�. this� continues unless we effect a division at some stage. For this it must happen that 𝑚𝑚𝑚𝑚𝑎𝑎𝑎𝑎 𝑢𝑢 𝑢𝑢𝑢𝑢𝑎𝑎𝑎𝑎, 𝑎𝑎𝑎𝑎 𝑢𝑢 𝑎𝑎𝑎𝑎𝑚𝑚𝑚𝑚 and Step 2: 𝑚𝑚𝑚𝑚 − 𝑢𝑢𝑢𝑢 are all divisible by 𝑎𝑎𝑎𝑎. This is how Bhāskarā’s lemma steps in, and this simple-minded reasoning is � 𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚6 � 7 𝑎𝑎𝑎𝑎 � 𝑛𝑛6−𝑛𝑛3 𝑎𝑎𝑎𝑎 𝑛𝑛 𝑛𝑛 𝑛𝑛 , 𝑎𝑎𝑎𝑎 𝑛𝑛 𝑛𝑛𝑛𝑛and 𝑎𝑎𝑎𝑎 𝑛𝑛 𝑛𝑛 −𝑛𝑛. the heuristic logic behind the Chakravāla. Here, then, is how the algorithm due to Jayadeva, | − 3| | − 3| −3 BhāskarachāryaSteps of the Chakravāla II and Narayana algorithm. Pandit works. Step 1: Step 0: We have obtained the triple [𝑎𝑎𝑎𝑎, 𝑎𝑎𝑎𝑎, 𝑎𝑎𝑎𝑎] 𝑛𝑛 �𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛�𝑛𝑛�. We go back to Step 1. � We want 𝑛𝑛𝑚𝑚 𝑎𝑎𝑚𝑚𝑎𝑎𝑎𝑎 to be divisible by −𝑛𝑛. Any integer value will do. We want 𝑎𝑎𝑎𝑎 such that |𝑎𝑎𝑎𝑎 − 𝑛𝑛3| Step 1: Start with a triple [𝑎𝑎𝑎𝑎𝑎𝑎 𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎] in which 𝑎𝑎𝑎𝑎 and 𝑎𝑎𝑎𝑎 are coprime. Stepis least. 2: So we choose 𝑎𝑎𝑎𝑎𝑎𝑎�. Look for values of 𝑚𝑚𝑚𝑚 such that 𝑎𝑎𝑎𝑎 𝑢𝑢 𝑎𝑎𝑎𝑎𝑚𝑚𝑚𝑚 is divisible by 𝑎𝑎𝑎𝑎. These values will form an arithmetic � � 7𝑚𝑚𝑚𝑚6𝑚𝑚 � 𝑛𝑛𝑚𝑚 𝑎𝑎𝑚𝑚𝑛𝑛 � 𝑛𝑛6−𝑛𝑛3 progression (AP) with common difference |𝑎𝑎𝑎𝑎�. From this AP, select that value of 𝑚𝑚𝑚𝑚 which makes |𝑚𝑚𝑚𝑚 − 𝑢𝑢𝑢𝑢� 𝑎𝑎𝑎𝑎 𝑛𝑛 𝑛𝑛𝑛𝑛37, 𝑎𝑎𝑎𝑎 𝑛𝑛 𝑛𝑛 3𝑚𝑚 and 𝑎𝑎𝑎𝑎 𝑛𝑛 𝑛𝑛 −3. |−𝑛𝑛| |−𝑛𝑛| −𝑛𝑛 theStep least. 2: � � � StepWe have 1: obtained the triple [𝑎𝑎𝑎𝑎, 𝑎𝑎𝑎𝑎, 𝑎𝑎𝑎𝑎] 𝑛𝑛 �𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛. Back to Step 1. Let 𝑎𝑎𝑎𝑎 𝑎𝑎𝑎𝑎𝑎𝑎 𝑎𝑎𝑎𝑎𝑎𝑎 be computed thus: � � 𝑚𝑚𝑚𝑚𝑎𝑎𝑎𝑎 𝑢𝑢 𝑢𝑢𝑢𝑢𝑎𝑎𝑎𝑎 � 𝑎𝑎𝑎𝑎 𝑢𝑢 𝑎𝑎𝑎𝑎𝑚𝑚𝑚𝑚 � 𝑚𝑚𝑚𝑚 − 𝑢𝑢𝑢𝑢 � We want 𝑛𝑛37 𝑎𝑎 3𝑚𝑚𝑚𝑚𝑚𝑚 to be divisible by −3. Hence 𝑎𝑎𝑎𝑎 𝑚𝑚 𝑚𝑚𝑚𝑚, 𝑚𝑚, 𝑚𝑚, 𝑛𝑛𝑛𝑛� 𝑚𝑚𝑚𝑚. The value of 𝑎𝑎𝑎𝑎 for which 𝑎𝑎𝑎𝑎 𝑢𝑢 𝑎𝑎𝑎𝑎𝑎𝑎𝑢𝑢 𝑎𝑎𝑎𝑎𝑎𝑎𝑢𝑢 𝑢𝑢 (11) |𝑎𝑎𝑎𝑎 − 𝑛𝑛3| is least is 𝑎𝑎𝑎𝑎𝑎𝑎𝑚𝑚. |𝑎𝑎𝑎𝑎� |𝑎𝑎𝑎𝑎� 𝑎𝑎𝑎𝑎 Step 2: � � � � � � � 𝑚𝑚74 𝑎𝑎 494 � 𝑛𝑛37 𝑎𝑎 76 � 4−𝑛𝑛3 Replace [𝑎𝑎𝑎𝑎𝑎𝑎 𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎] by [𝑎𝑎𝑎𝑎 𝑎𝑎𝑎𝑎𝑎𝑎 𝑎𝑎𝑎𝑎𝑎𝑎 ]. ( That is, [𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎] 𝑎𝑎 [𝑎𝑎𝑎𝑎 𝑎𝑎𝑎𝑎𝑎𝑎 𝑎𝑎𝑎𝑎𝑎𝑎 ], to use “computer grammar”.) If the third 𝑎𝑎𝑎𝑎 𝑛𝑛 𝑛𝑛 𝑛𝑛𝑛𝑛6, 𝑎𝑎𝑎𝑎 𝑛𝑛 𝑛𝑛 7𝑛𝑛 and 𝑎𝑎𝑎𝑎 𝑛𝑛 𝑛𝑛 3. coordinate of the new triple is 𝑛𝑛, then this is the triple we seek; end of story. Else, go back to Step 1 and |−3| | − 3| −3 start a fresh cycle of computations. We have obtained the triple [𝑎𝑎𝑎𝑎, 𝑎𝑎𝑎𝑎, 𝑎𝑎𝑎𝑎] 𝑛𝑛 𝑛𝑛𝑛𝑛𝑛𝑛�𝑛𝑛𝑛𝑛. Back to Step 1.

1716 At Right Angles | Vol. 3, No. 3, November 2014 Vol. 3, No. 3, November 2014 | At Right Angles 1716 4 At Right Angles ∣ Vol. 3, No. 3, November 2014 Vol. 3, No. 3, November 2014 ∣ At Right Angles 5 The ‘cycle’ tells us why Bhāskarā called this the Chakravāla. We show the working of the algorithm using a fewExample examples. 1.

� �Let 𝑛𝑛𝑛𝑛 𝑛𝑛𝑛𝑛𝑛𝑛. Let us start with the trivial triple [4, 𝑛𝑛, 6], that is, with the relation 4Step− 𝑛𝑛𝑛𝑛 0: × 𝑛𝑛 𝑛𝑛 6, and see where it leads us. Step 1: [𝑎𝑎𝑎𝑎, 𝑎𝑎𝑎𝑎, 𝑎𝑎𝑎𝑎] 𝑛𝑛 𝑛� 𝑛𝑛𝑛𝑛.

We want 𝑎𝑎𝑎𝑎 𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎 to� be divisible by 𝑎𝑎𝑎𝑎, i.e., 4 𝑎𝑎𝑎𝑎𝑎𝑎to be divisible by 6. Hence 𝑎𝑎𝑎𝑎 𝑚𝑚 𝑚𝑚𝑚𝑚, 𝑚𝑚, 𝑛𝑛𝑛 𝑚𝑚𝑛𝑛� 𝑚𝑚𝑚𝑚. StepThe value 2: of 𝑎𝑎𝑎𝑎 for which 𝑎𝑎𝑎𝑎 − 𝑛𝑛𝑛𝑛 is least is 𝑎𝑎𝑎𝑎𝑎𝑎𝑚𝑚. � 𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚 � 4 𝑎𝑎𝑎𝑎 � 4−𝑛𝑛𝑛𝑛 𝑎𝑎𝑎𝑎 𝑛𝑛 𝑛𝑛 3, 𝑎𝑎𝑎𝑎 𝑛𝑛 𝑛𝑛𝑛𝑛and 𝑎𝑎𝑎𝑎 𝑛𝑛 𝑛𝑛 −𝑛𝑛. |6| |6| 6 StepWe have 1: obtained the triple [𝑎𝑎𝑎𝑎, 𝑎𝑎𝑎𝑎, 𝑎𝑎𝑎𝑎] 𝑛𝑛 𝑛� 𝑛𝑛𝑛�𝑛𝑛�. Since the third coordinate is not 𝑛𝑛, we go back to Step 1. � We want 3 𝑎𝑎𝑎𝑎𝑎𝑎to be divisible by −𝑛𝑛. Any integer value will do. We also want |𝑎𝑎𝑎𝑎 − 𝑛𝑛𝑛𝑛| to be as Stepsmall 2: as possible. So we choose 𝑎𝑎𝑎𝑎𝑎𝑎�. � 9 𝑎𝑎 𝑎𝑎𝑎𝑎 � 3 𝑎𝑎 3 � 9−𝑛𝑛𝑛𝑛 𝑎𝑎𝑎𝑎 𝑛𝑛 𝑛𝑛𝑛𝑛9, 𝑎𝑎𝑎𝑎 𝑛𝑛 𝑛𝑛 6 and 𝑎𝑎𝑎𝑎 𝑛𝑛 𝑛𝑛𝑛𝑛. |−𝑛𝑛| |−𝑛𝑛| −𝑛𝑛 We have obtained the triple [𝑎𝑎𝑎𝑎, 𝑎𝑎𝑎𝑎, 𝑎𝑎𝑎𝑎] 𝑛𝑛 �𝑛𝑛𝑛𝑛� 𝑛𝑛�. Now the third coordinate is 𝑛𝑛, so the computations are over, and we have obtained a solution to the problem: � � Example 2. 𝑛𝑛9 − 𝑛𝑛𝑛𝑛 ×6 𝑛𝑛𝑛𝑛. � � Step 0: Let 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛3. We start with the trivial triple [4, 𝑛𝑛, 3], that is, with the relation 4 − 𝑛𝑛3×𝑛𝑛 𝑛𝑛 3. Step 1: [𝑎𝑎𝑎𝑎, 𝑎𝑎𝑎𝑎, 𝑎𝑎𝑎𝑎] 𝑛𝑛 𝑛� 𝑛𝑛𝑛𝑛.

We want 𝑎𝑎𝑎𝑎� 𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎 to be divisible by 𝑎𝑎𝑎𝑎, i.e., 4 𝑎𝑎𝑎𝑎𝑎𝑎to be divisible by 3. Hence 𝑎𝑎𝑎𝑎 𝑚𝑚 𝑚𝑚𝑚𝑚, 𝑚𝑚, 𝑚𝑚, 𝑛𝑛𝑛𝑛� 𝑚𝑚𝑚𝑚. The Stepvalue 2: of 𝑎𝑎𝑎𝑎 for which 𝑎𝑎𝑎𝑎 − 𝑛𝑛3 is least is 𝑎𝑎𝑎𝑎𝑎𝑎𝑚𝑚. � 𝑚𝑚𝑚𝑚𝑚𝑚3 � 4 𝑎𝑎𝑎𝑎 � 4−𝑛𝑛3 𝑎𝑎𝑎𝑎 𝑛𝑛 𝑛𝑛 7, 𝑎𝑎𝑎𝑎 𝑛𝑛 𝑛𝑛𝑛𝑛and 𝑎𝑎𝑎𝑎 𝑛𝑛 𝑛𝑛 −3. |3| |3| 3 WeStep have 1: obtained the triple [𝑎𝑎𝑎𝑎, 𝑎𝑎𝑎𝑎, 𝑎𝑎𝑎𝑎] 𝑛𝑛 𝑛𝑛𝑛𝑛𝑛𝑛�. As the third coordinate is not 𝑛𝑛, we go back to Step 1.

� We want 7 𝑎𝑎 𝑎𝑎𝑎𝑎𝑎𝑎 to be divisible by −3. Hence 𝑎𝑎𝑎𝑎 𝑚𝑚𝑚𝑚𝑛𝑛𝑛𝑛𝑛� 𝑛𝑛𝑛𝑛� 𝑚𝑚𝑚𝑚. The value of 𝑎𝑎𝑎𝑎 for which |Step𝑎𝑎𝑎𝑎 − 2:𝑛𝑛3| is least is 𝑎𝑎𝑎𝑎𝑎𝑎�. � 𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚6 � 7 𝑎𝑎𝑎𝑎 � 𝑛𝑛6−𝑛𝑛3 𝑎𝑎𝑎𝑎 𝑛𝑛 𝑛𝑛 𝑛𝑛 , 𝑎𝑎𝑎𝑎 𝑛𝑛 𝑛𝑛𝑛𝑛and 𝑎𝑎𝑎𝑎 𝑛𝑛 𝑛𝑛 −𝑛𝑛. | − 3| | − 3| −3 StepWe have 1: obtained the triple [𝑎𝑎𝑎𝑎, 𝑎𝑎𝑎𝑎, 𝑎𝑎𝑎𝑎] 𝑛𝑛 �𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛�𝑛𝑛�. We go back to Step 1. � We want 𝑛𝑛𝑚𝑚 𝑎𝑎𝑚𝑚𝑎𝑎𝑎𝑎 to be divisible by −𝑛𝑛. Any integer value will do. We want 𝑎𝑎𝑎𝑎 such that |𝑎𝑎𝑎𝑎 − 𝑛𝑛3| Stepis least. 2: So we choose 𝑎𝑎𝑎𝑎𝑎𝑎�. � 7𝑚𝑚𝑚𝑚6𝑚𝑚 � 𝑛𝑛𝑚𝑚 𝑎𝑎𝑚𝑚𝑛𝑛 � 𝑛𝑛6−𝑛𝑛3 𝑎𝑎𝑎𝑎 𝑛𝑛 𝑛𝑛𝑛𝑛37, 𝑎𝑎𝑎𝑎 𝑛𝑛 𝑛𝑛 3𝑚𝑚 and 𝑎𝑎𝑎𝑎 𝑛𝑛 𝑛𝑛 −3. |−𝑛𝑛| |−𝑛𝑛| −𝑛𝑛 StepWe have 1: obtained the triple [𝑎𝑎𝑎𝑎, 𝑎𝑎𝑎𝑎, 𝑎𝑎𝑎𝑎] 𝑛𝑛 �𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛. Back to Step 1.

� We want 𝑛𝑛37 𝑎𝑎 3𝑚𝑚𝑚𝑚𝑚𝑚 to be divisible by −3. Hence 𝑎𝑎𝑎𝑎 𝑚𝑚 𝑚𝑚𝑚𝑚, 𝑚𝑚, 𝑚𝑚, 𝑛𝑛𝑛𝑛� 𝑚𝑚𝑚𝑚. The value of 𝑎𝑎𝑎𝑎 for which Step|𝑎𝑎𝑎𝑎 − 2:𝑛𝑛3| is least is 𝑎𝑎𝑎𝑎𝑎𝑎𝑚𝑚. � 𝑚𝑚74 𝑎𝑎 494 � 𝑛𝑛37 𝑎𝑎 76 � 4−𝑛𝑛3 𝑎𝑎𝑎𝑎 𝑛𝑛 𝑛𝑛 𝑛𝑛𝑛𝑛6, 𝑎𝑎𝑎𝑎 𝑛𝑛 𝑛𝑛 7𝑛𝑛 and 𝑎𝑎𝑎𝑎 𝑛𝑛 𝑛𝑛 3. |−3| | − 3| −3 We have obtained the triple [𝑎𝑎𝑎𝑎, 𝑎𝑎𝑎𝑎, 𝑎𝑎𝑎𝑎] 𝑛𝑛 𝑛𝑛𝑛𝑛𝑛𝑛�𝑛𝑛𝑛𝑛. Back to Step 1.

17 At Right Angles | Vol. 3, No. 3, November 2014 Vol. 3, No. 3, November 2014 | At Right Angles 17 Vol. 3, No. 3, November 2014 ∣ At Right Angles 5 Step 1:

� We want 256 + 71𝑚𝑚𝑚𝑚 to be divisible by 3. Hence 𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚1𝑚𝑚 𝑚𝑚𝑚𝑚 7𝑚𝑚 1𝑚𝑚𝑚𝑚 𝑚𝑚𝑚𝑚. The value of 𝑚𝑚𝑚𝑚 for which Step|𝑚𝑚𝑚𝑚 − 2: 13| is least is 𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚. Ingenuity in Algebra � 1𝑚𝑚2𝑚𝑚 + 923 � 256 + 28𝑚𝑚 � 16 − 13 𝑎𝑎𝑎𝑎 𝑚𝑚 𝑚𝑚 6𝑚𝑚9, 𝑏𝑏𝑏𝑏 𝑚𝑚 𝑚𝑚 18𝑚𝑚 and 𝑘𝑘𝑘𝑘 𝑚𝑚 𝑚𝑚 1. |3| |3| 3 We have obtained the triple [6𝑚𝑚9𝑚𝑚 18𝑚𝑚𝑚𝑚 1]. Now the third coordinate is 1 so the computations are over. Gems from Here is our solution: � � Remark. - - - 6𝑚𝑚9 −13×18𝑚𝑚 𝑚𝑚 1. Bhaskaracharya II We have described the working of the Chakravāla, but we have not attempted to show that it will always yield an answer. For this, we must show that we will reach a triple [𝑢𝑢𝑢𝑢𝑚𝑚 𝑢𝑢𝑢𝑢𝑚𝑚 𝑚 no matter with Ingenuity in Algebra which triple [𝑎𝑎𝑎𝑎𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚�we start the computation; of course, we do need GCD (𝑎𝑎𝑎𝑎𝑚𝑚𝑚𝑚𝑚𝑚𝑎𝑎 𝑚𝑚�. Interested readers Number Problems may refer to [1] or [3] for proof that the Chakravāla algorithm works. know from Ancient India Gems from feature Had the ancients considered such a question? Did Jayadeva, Bhāskarā and Narayana Pandit that the Chakravāla algorithm would invariably give a solution? We do not know. - - - In closing we note that there are some steps that serve as shortcuts. Brahmagupta found that if we ever Bhaskaracharya II reach a triple [𝑎𝑎𝑎𝑎𝑚𝑚 𝑚𝑚𝑚𝑚𝑚𝑚 𝑚𝑚𝑚𝑚� with 𝑘𝑘𝑘𝑘 𝑚𝑚𝑚𝑚𝑘𝑘𝑚𝑚𝑚𝑚 𝑘𝑘2𝑚𝑚 𝑚𝑚𝑚, then we can reach the desired end (with third coordinate equal to 1) in a single step, thus shortening the computations greatly. We do not study these shortcuts Number Problems here.Exercises. Please refer to [3] for details. fromhāskarā Ancient II, pre-eminent India mathematician-astronomer Using the Chakravāla, �ind some positive integer solutions to the following equations. Use any of ancient India, was born in 1114 AD in Bijapur convenient starting triple of your own choice in each case. (present-day Karnataka). Thus, the present year marks � � � � his nine hundredth birth anniversary. Events have been (1) 𝑥𝑥𝑥𝑥 − 8𝑦𝑦𝑦𝑦 𝑚𝑚 1 (4) 𝑥𝑥𝑥𝑥 − 17𝑦𝑦𝑦𝑦 𝑚𝑚 1 � � � � organized across the country in honour of this event. (2) 𝑥𝑥𝑥𝑥 − 11𝑦𝑦𝑦𝑦 𝑚𝑚 1 (5) 𝑥𝑥𝑥𝑥 − 19𝑦𝑦𝑦𝑦 𝑚𝑚 1 � � � � Bhāskarā served as headLīlāvatī of an astronomical observatory (3) 𝑥𝑥𝑥𝑥 − 15𝑦𝑦𝑦𝑦 𝑚𝑚 1 (6) 𝑥𝑥𝑥𝑥 − 𝑚𝑚1𝑦𝑦𝑦𝑦 𝑚𝑚 1 located at Ujjain (in present-day Madhya Pradesh). He is best Remark. Siddhānta Siromani known for his work (‘The Beautiful’). This book least hāskarā II, pre-eminent mathematician-astronomer occurs as part of a larger work, (‘Crown of � �Using the Chakravāla, Bhāskarā found the following positive integer solution to the equation B ofBījagaṇita ancient India, was born in 1114 AD in Bijapur 𝑥𝑥𝑥𝑥 − 61𝑦𝑦𝑦𝑦 𝑚𝑚 1 (it is the such!): 𝑥𝑥𝑥𝑥 𝑚𝑚 𝑚𝑚𝑚�𝑚𝑚𝑚𝑚�, 𝑦𝑦𝑦𝑦 𝑚𝑚 𝑚𝑚𝑚𝑚𝑚𝑚. Treatises’),(present-dayGrahagaṇita which also Karnataka). has an important Thus, the section present on year advanced marks References algebra,hisGolādhyāya nine hundredth(‘Seed birth anniversary. Arithmetic’), Events and two have works been on An Elementary Proof of the Halting Property of the Chakravāla Algorithm organizedastronomy, across the country, on the in motionshonour of of this planets, event. and (‘The Sphere’). This work was written when he [1] Bauval, A. , BhāskarāwasLīlāvatī36 years served old. as headLīlāvatī of an astronomical observatory http://arxiv.org/pdf/1406.6809v1.pdf Chakravāla, A Modern Indian Method located at Ujjain (in present-daySiddhānta Madhya Pradesh). Siromani He is best [2] MacTutor HistoryAlgebra of Mathematics. in Ancient Pell’s and Modern equation. Timeshttp://www-history.mcs.st-and.ac.uk/HistTopics/Pell.html known foris a his work work on basic mathematics,(‘The Beautiful’). covering This arithmetic, book [3] Sury, B. . http://www.isibang.ac.in/ sury/chakravala.pdf simple algebra, geometry and simple mensuration. The from Hammurapi to Legendre occurs asBījagaṇita part of a larger work, (‘Crown of [4] Varadarajan,Chakravala V S. method . American Mathematical Society (1998). Bfamous ‘Behold!’ proof-without-words of the Pythagorean Treatises’), which also has an important section on advanced [5] Weil, André. . Birkhaüser (1984). theorem (seeGrahagaṇita Figure 1) is from thisLīlāvatī book. [6] Wikipedia, . https://en.wikipedia.org/wiki/Chakravala_method algebra,Golādhyāya (‘Seed Arithmetic’), and two works on Thereastronomy, is a lovely legend behind, on the motionswhich of planets, is worth and quoting. The(‘The legend Sphere’). goes that This Bhāskarā work was had written a daughter when named he Lı̄lāvatı̄.wasLīlāvatī36 years She came old. of age, her wedding was arranged, and the long-awaitedis a work day �inallyon basic came. mathematics, The young covering Lı̄lāvatı̄, arithmetic, ever curious about things around her, peeped into the water clock SHAILESH SHIRALI is Director of Sahyadri School (KFI), Pune, and Head of the Community Mathematics Centre simple algebra, geometry and simple mensuration. The in Rishi Valley School (AP). He has been closely involved with the Math Olympiad movement in India. He is famous ‘Behold!’ proof-without-words of the Pythagorean the author of many mathematics books for high school students, and serves as an editor for Resonance and Līlāvatī At Right Angles. He may be contacted at [email protected]. theorem (see Figure 1) is from this book. There is a lovely legend behind which is worth quoting. The legend goes that Bhāskarā had a daughter named Lı̄lāvatı̄. She came of age, her wedding was arranged, and the long-awaited day �inally came. The young Lı̄lāvatı̄, ever

1918 At Right Angles | Vol. 3, No. 3, November 2014 curious about things around her, peeped into the water clock Vol. 3, No. 3, November 2014 | At Right Angles 1918 6 At Right Angles ∣ Vol. 3, No. 3, November 2014