<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://indianpedia.org/index.php?action=history&amp;feed=atom&amp;title=Chakravala_method</id>
	<title>Chakravala method - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://indianpedia.org/index.php?action=history&amp;feed=atom&amp;title=Chakravala_method"/>
	<link rel="alternate" type="text/html" href="https://indianpedia.org/index.php?title=Chakravala_method&amp;action=history"/>
	<updated>2026-07-30T22:03:36Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.4</generator>
	<entry>
		<id>https://indianpedia.org/index.php?title=Chakravala_method&amp;diff=111131&amp;oldid=prev</id>
		<title>&gt;WikiCleanerBot at 04:11, 21 June 2021</title>
		<link rel="alternate" type="text/html" href="https://indianpedia.org/index.php?title=Chakravala_method&amp;diff=111131&amp;oldid=prev"/>
		<updated>2021-06-21T04:11:33Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Short description|Cyclic algorithm to solve indeterminate quadratic equations}}&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;chakravala&amp;#039;&amp;#039; method&amp;#039;&amp;#039;&amp;#039; ({{lang-sa|चक्रवाल विधि}}) is a cyclic [[algorithm]] to solve [[Indeterminate equation|indeterminate]] [[quadratic equation]]s, including [[Pell&amp;#039;s equation]]. It is commonly attributed to [[Bhāskara II]], (c. 1114 – 1185 CE)&amp;lt;ref name=SBI200&amp;gt;Hoiberg &amp;amp; Ramchandani – Students&amp;#039; Britannica India: Bhaskaracharya II, page 200&amp;lt;/ref&amp;gt;&amp;lt;ref name=Kumar23&amp;gt;Kumar, page 23&amp;lt;/ref&amp;gt; although some attribute it to [[Jayadeva (mathematician)|Jayadeva]] (c.  950 ~ 1000 CE).&amp;lt;ref name=Plofker474&amp;gt;Plofker, page 474&amp;lt;/ref&amp;gt; Jayadeva pointed out that [[Brahmagupta]]&amp;#039;s approach to solving equations of this type could be generalized, and he then described this general method, which was later refined by Bhāskara II in his &amp;#039;&amp;#039;[[Bijaganita]]&amp;#039;&amp;#039; treatise. He called it the Chakravala method: &amp;#039;&amp;#039;chakra&amp;#039;&amp;#039; meaning &amp;quot;wheel&amp;quot; in [[Sanskrit]], a reference to the cyclic nature of the algorithm.&amp;lt;ref name= Goonatilake127&amp;gt;Goonatilake, page 127 &amp;amp;ndash; 128&amp;lt;/ref&amp;gt; C.-O. Selenius held that no European performances at the time of Bhāskara, nor much later, exceeded its marvellous height of mathematical complexity.&amp;lt;ref name=SBI200/&amp;gt;&amp;lt;ref name= Goonatilake127/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This method is also known as the &amp;#039;&amp;#039;&amp;#039;cyclic method&amp;#039;&amp;#039;&amp;#039; and contains traces of [[mathematical induction]].&amp;lt;ref&amp;gt;Cajori (1918), p. 197&amp;lt;blockquote&amp;gt;&amp;quot;The process of reasoning called &amp;quot;Mathematical Induction&amp;quot; has had several independent origins. It has been traced back to the Swiss Jakob (James) Bernoulli, the Frenchman B. Pascal and P. Fermat, and the Italian F. Maurolycus. [...] By reading a little between the lines one can find traces of mathematical induction still earlier, in the writings of the Hindus and the Greeks, as, for instance, in the &amp;quot;cyclic method&amp;quot; of Bhaskara, and in Euclid&amp;#039;s proof that the number of primes is infinite.&amp;quot;&amp;lt;/blockquote&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
&amp;#039;&amp;#039;Chakra&amp;#039;&amp;#039; in Sanskrit means cycle. As per popular legend, Chakravala indicates a mythical range of mountains which orbits around the earth like a wall and not limited by light and darkness.&amp;lt;ref name=Madan&amp;gt;{{cite book|title=India through the ages|url=https://archive.org/details/indiathroughages00mada|last=Gopal|first=Madan|year= 1990| page= [https://archive.org/details/indiathroughages00mada/page/79 79]|editor=K.S. Gautam|publisher=Publication Division, Ministry of Information and Broadcasting, Government of India}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Brahmagupta]] in 628 CE studied indeterminate quadratic equations, including [[Pell&amp;#039;s equation]]&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\,x^2 = Ny^2 + 1,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
for minimum integers &amp;#039;&amp;#039;x&amp;#039;&amp;#039; and &amp;#039;&amp;#039;y&amp;#039;&amp;#039;. Brahmagupta could solve it for several &amp;#039;&amp;#039;N&amp;#039;&amp;#039;, but not all.&lt;br /&gt;
&lt;br /&gt;
Jayadeva (9th century) and Bhaskara (12th century) offered the first complete solution to the equation, using the &amp;#039;&amp;#039;chakravala&amp;#039;&amp;#039; method to find for &amp;lt;math&amp;gt;\,x^2 = 61y^2 + 1,&amp;lt;/math&amp;gt; the solution&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\,x = 1 766 319 049, y = 226 153 980.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This case was notorious for its difficulty, and was first solved in [[Europe]] by [[William Brouncker, 2nd Viscount Brouncker|Brouncker]] in 1657–58 in response to a challenge by [[Pierre de Fermat|Fermat]], using continued fractions. A method for the general problem was first completely described rigorously by [[Lagrange]] in 1766.&amp;lt;ref&amp;gt;{{MacTutor|class=HistTopics|id=Pell|title=Pell&amp;#039;s equation}}&amp;lt;/ref&amp;gt; Lagrange&amp;#039;s method, however, requires the calculation of 21 successive convergents of the [[continued fraction]] for the [[square root]] of 61, while the &amp;#039;&amp;#039;chakravala&amp;#039;&amp;#039; method is much simpler. Selenius, in his assessment of the &amp;#039;&amp;#039;chakravala&amp;#039;&amp;#039; method, states&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;The method represents a best approximation algorithm of minimal length that, owing to several minimization properties, with minimal effort and avoiding large numbers automatically produces the best solutions to the equation. The &amp;#039;&amp;#039;chakravala&amp;#039;&amp;#039; method anticipated the European methods by more than a thousand years. But no European performances in the whole field of [[algebra]] at a time much later than Bhaskara&amp;#039;s, nay nearly equal up to our times, equalled the marvellous complexity and ingenuity of &amp;#039;&amp;#039;chakravala&amp;#039;&amp;#039;.&amp;quot;&amp;lt;ref name=SBI200/&amp;gt;&amp;lt;ref name= Goonatilake127/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Hermann Hankel]] calls the &amp;#039;&amp;#039;chakravala&amp;#039;&amp;#039; method&lt;br /&gt;
:&amp;quot;the finest thing achieved in the theory of numbers before Lagrange.&amp;quot;&amp;lt;ref&amp;gt;Kaye (1919), p. 337.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The method==&lt;br /&gt;
From [[Brahmagupta&amp;#039;s identity]], we observe that for given &amp;#039;&amp;#039;N&amp;#039;&amp;#039;,&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;(x_1x_2 + Ny_1y_2)^2 - N(x_1y_2 + x_2y_1)^2 = (x_1^2 - Ny_1^2)(x_2^2 - Ny_2^2)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the equation &amp;lt;math&amp;gt;x^2 - Ny^2 = k&amp;lt;/math&amp;gt;, this allows the &amp;quot;composition&amp;quot; (&amp;#039;&amp;#039;samāsa&amp;#039;&amp;#039;) of two solution triples &amp;lt;math&amp;gt;(x_1, y_1, k_1)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(x_2, y_2, k_2)&amp;lt;/math&amp;gt; into a new triple&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;(x_1x_2 + Ny_1y_2 \,,\, x_1y_2 + x_2y_1 \,,\, k_1k_2).&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the general method, the main idea is that any triple &amp;lt;math&amp;gt;(a,b,k)&amp;lt;/math&amp;gt; (that is, one which satisfies &amp;lt;math&amp;gt;a^2 - Nb^2 = k&amp;lt;/math&amp;gt;) can be composed with the trivial triple &amp;lt;math&amp;gt;(m, 1, m^2 - N)&amp;lt;/math&amp;gt; to get the new triple &amp;lt;math&amp;gt;(am + Nb, a+bm, k(m^2-N))&amp;lt;/math&amp;gt; for any &amp;#039;&amp;#039;m&amp;#039;&amp;#039;. Assuming we started with a triple for which &amp;lt;math&amp;gt;\gcd(a,b)=1&amp;lt;/math&amp;gt;, this can be scaled down by &amp;#039;&amp;#039;k&amp;#039;&amp;#039; (this is [[Bhaskara&amp;#039;s lemma]]):&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;a^2 - Nb^2 = k \Rightarrow \left(\frac{am+Nb}{k}\right)^2 - N\left(\frac{a+bm}{k}\right)^2 = \frac{m^2-N}{k}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the signs inside the squares do not matter, the following substitutions are possible:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;a\leftarrow\frac{am+Nb}{|k|}, b\leftarrow\frac{a+bm}{|k|}, k\leftarrow\frac{m^2-N}{k}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When a positive integer &amp;#039;&amp;#039;m&amp;#039;&amp;#039; is chosen so that (&amp;#039;&amp;#039;a&amp;#039;&amp;#039;&amp;amp;nbsp;+&amp;amp;nbsp;&amp;#039;&amp;#039;bm&amp;#039;&amp;#039;)/&amp;#039;&amp;#039;k&amp;#039;&amp;#039; is an integer, so are the other two numbers in the triple. Among such &amp;#039;&amp;#039;m&amp;#039;&amp;#039;, the method chooses one that minimizes the absolute value of &amp;#039;&amp;#039;m&amp;#039;&amp;#039;&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;&amp;amp;nbsp;&amp;amp;minus;&amp;amp;nbsp;&amp;#039;&amp;#039;N&amp;#039;&amp;#039; and hence that of (&amp;#039;&amp;#039;m&amp;#039;&amp;#039;&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;&amp;amp;nbsp;&amp;amp;minus;&amp;amp;nbsp;&amp;#039;&amp;#039;N&amp;#039;&amp;#039;)/&amp;#039;&amp;#039;k&amp;#039;&amp;#039;. Then the substitution relations are applied for &amp;#039;&amp;#039;m&amp;#039;&amp;#039; equal to the chosen value. This results in a new triple (&amp;#039;&amp;#039;a&amp;#039;&amp;#039;, &amp;#039;&amp;#039;b&amp;#039;&amp;#039;, &amp;#039;&amp;#039;k&amp;#039;&amp;#039;). The process is repeated until a triple with &amp;lt;math&amp;gt;k=1&amp;lt;/math&amp;gt; is found. This method always terminates with a solution (proved by Lagrange in 1768).&amp;lt;ref name=stillwell&amp;gt;{{citation | year=2002 | title = Mathematics and its history | author1=John Stillwell | author-link=John Stillwell | edition=2 | publisher=Springer | isbn=978-0-387-95336-6 | pages=72–76 | url=https://books.google.com/books?id=WNjRrqTm62QC&amp;amp;pg=PA72}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
Optionally, we can stop when &amp;#039;&amp;#039;k&amp;#039;&amp;#039; is ±1, ±2, or ±4, as Brahmagupta&amp;#039;s approach gives a solution for those cases.&lt;br /&gt;
&lt;br /&gt;
== Brahmagupta&amp;#039;s Composition Method ==&lt;br /&gt;
In 628 AD, Brahmagupta discovered a general way to find &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;x^2 = Ny^2 + 1,&amp;lt;/math&amp;gt; when given &amp;lt;math&amp;gt;a^2 = Nb^2 + k&amp;lt;/math&amp;gt;, when k is ±1, ±2, or ±4.&amp;lt;ref&amp;gt;{{Cite web|title=Pell&amp;#039;s equation|url=https://mathshistory.st-andrews.ac.uk/HistTopics/Pell/|access-date=2021-06-14|website=Maths History|language=en}}&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
=== k = -1 ===&lt;br /&gt;
Using [[Brahmagupta&amp;#039;s identity]], to compose the triple &amp;lt;math&amp;gt;(a,b,k)&amp;lt;/math&amp;gt; with itself:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(a^2+Nb^2)^2-N(2ab)^2=k^2&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;\Rightarrow&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;(2a^2-k)^2-N(2ab)^2=k^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The new triple can be expressed as &amp;lt;math&amp;gt;(2a^2-k,2ab,k^2)&amp;lt;/math&amp;gt;. Substituting &amp;lt;math&amp;gt;k=-1&amp;lt;/math&amp;gt; to get the solution:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x=a^2+1, &lt;br /&gt;
y=2ab&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== k = ±2 ===&lt;br /&gt;
Again using the equation, &amp;lt;math&amp;gt;(2a^2-k)^2-N(2ab)^2=k^2&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;\Rightarrow&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;(\frac{2a^2-k}{k})^2-N(\frac{2ab}{k})^2=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting &amp;lt;math&amp;gt;k=2&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x=a^2-1, &lt;br /&gt;
y=ab&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting &amp;lt;math&amp;gt;k=-2&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x=a^2+1, &lt;br /&gt;
y=ab&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== k = 4 ===&lt;br /&gt;
Substituting &amp;lt;math&amp;gt;k=4&amp;lt;/math&amp;gt; into the equation &amp;lt;math&amp;gt;(\frac{2a^2-4}{4})^2-N(\frac{2ab}{4})^2=1&amp;lt;/math&amp;gt; creates the triple &amp;lt;math&amp;gt;(\frac{a^2-2}{2},\frac{ab}{2},1)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Which is a solution if &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; is even:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x=\frac{ab}{2},&lt;br /&gt;
y=\frac{a^2-2}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If a is odd, start with the equations &amp;lt;math&amp;gt;(\frac{a}{2})^2-N(\frac{b}{2})^2=1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(\frac{2a^2-4}{4})^2-N(\frac{2ab}{4})^2=1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Leading to the triples &amp;lt;math&amp;gt;(\frac{a}{2},\frac{b}{2},1)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(\frac{a^2-2}{2},\frac{ab}{2},1)&amp;lt;/math&amp;gt;. Composing the triples gives &amp;lt;math&amp;gt;(\frac{a}{2}(a^2-3))^2-N(\frac{b}{2}(a^2-1))^2=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; is odd,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x=\frac{a}{2}(a^2-3))^2,&lt;br /&gt;
y=(\frac{b}{2}(a^2-1))^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== k = -4 ===&lt;br /&gt;
When &amp;lt;math&amp;gt;k=-4&amp;lt;/math&amp;gt;, then &amp;lt;math&amp;gt;(\frac{a}{2})^2-N(\frac{b}{2})^2=-1&amp;lt;/math&amp;gt;. Composing with itself yields &amp;lt;math&amp;gt;(\frac{a^2+Nb^2}{4})^2-N(\frac{ab}{2})^2=1&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;\Rightarrow&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;(\frac{a^2+2}{2})^2-N(\frac{ab}{2})^2=1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Again composing itself yields &amp;lt;math&amp;gt;(\frac{(a^2+2)^2+Na^2b^2)}{4})^2-N(\frac{ab(a^2+2)}{2})^2=1&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;\Rightarrow&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;(\frac{a^4+4a^2+2}{2})^2-N(\frac{ab(a^2+2)}{2})^2=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, from the earlier equations, compose the triples &amp;lt;math&amp;gt;(\frac{a^2+2}{2},\frac{ab}{2},1)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(\frac{a^4+4a^2+2}{2},\frac{ab(a^2+2)}{2},1)&amp;lt;/math&amp;gt;, to get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{(a^2+2)(a^4+4a^2+2)+Na^2b^2 (a^2+2)}{4})^2-N(\frac{ab(a^4+4a^2+3)}{2})^2=1&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;\Rightarrow&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;(\frac{(a^2+2)(a^4+4a^2+1)}{2})^2-N(\frac{ab(a^2+3)(a^2+1)}{2})^2=1&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;\Rightarrow&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;(\frac{(a^2+2)[(a^2+1)(a^2+3)-2)]}{2})^2-N(\frac{ab(a^2+3)(a^2+1)}{2})^2=1&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
This give us the solutions&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x=\frac{(a^2+2)[(a^2+1)(a^2+3)-2)]}{2}&lt;br /&gt;
y=\frac{ab(a^2+3)(a^2+1)}{2}&amp;lt;/math&amp;gt;&amp;lt;ref&amp;gt;{{Cite book|last=Datta and Singh|title=History of Hindu Mathematics : A Source Book Parts I and II|publisher=Asia Publishing House|year=1962|isbn=9780043940288|pages=157-160}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Note, &amp;lt;math&amp;gt;k=-4&amp;lt;/math&amp;gt; is useful to find a solution to [[Pell&amp;#039;s equation|Pell&amp;#039;s Equation]], but it is not always the smallest integer pair. e.g. &amp;lt;math&amp;gt;36^2-52*5^2=-4&amp;lt;/math&amp;gt;. The equation will give you &amp;lt;math&amp;gt;x=1093436498,y=151632270&amp;lt;/math&amp;gt;, which when put into Pell&amp;#039;s Equation yields &amp;lt;math&amp;gt;1195601955878350801-119560195587835080 = 1&amp;lt;/math&amp;gt;, which works, but so does &amp;lt;math&amp;gt;x = 649,y=90&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;N=52&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Examples ==&lt;br /&gt;
===&amp;#039;&amp;#039;n&amp;#039;&amp;#039; = 61===&lt;br /&gt;
The &amp;#039;&amp;#039;n&amp;#039;&amp;#039;&amp;amp;nbsp;=&amp;amp;nbsp;61 case (determining an integer solution satisfying &amp;lt;math&amp;gt;a^2 - 61b^2 = 1&amp;lt;/math&amp;gt;), issued as a challenge by Fermat many centuries later, was given by Bhaskara as an example.&amp;lt;ref name=stillwell/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We start with a solution &amp;lt;math&amp;gt;a^2 - 61b^2 = k&amp;lt;/math&amp;gt; for any &amp;#039;&amp;#039;k&amp;#039;&amp;#039; found by any means. In this case we can let &amp;#039;&amp;#039;b&amp;#039;&amp;#039; be 1, thus, since &amp;lt;math&amp;gt;8^2 - 61\cdot1^2 = 3&amp;lt;/math&amp;gt;, we have the triple &amp;lt;math&amp;gt;(a,b,k) = (8, 1, 3)&amp;lt;/math&amp;gt;. Composing it with &amp;lt;math&amp;gt;(m, 1, m^2-61)&amp;lt;/math&amp;gt; gives the triple &amp;lt;math&amp;gt;(8m+61, 8+m, 3(m^2-61))&amp;lt;/math&amp;gt;, which is scaled down (or [[Bhaskara&amp;#039;s lemma]] is directly used) to get:&lt;br /&gt;
: &amp;lt;math&amp;gt;\left( \frac{8m+61}{3}, \frac{8+m}{3}, \frac{m^2-61}{3} \right).&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For 3 to divide &amp;lt;math&amp;gt;8+m&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;|m^2-61|&amp;lt;/math&amp;gt; to be minimal, we choose &amp;lt;math&amp;gt;m=7&amp;lt;/math&amp;gt;, so that we have the triple &amp;lt;math&amp;gt;(39, 5, -4)&amp;lt;/math&amp;gt;. Now that &amp;#039;&amp;#039;k&amp;#039;&amp;#039; is &amp;amp;minus;4, we can use Brahmagupta&amp;#039;s idea: it can be scaled down to the rational solution &amp;lt;math&amp;gt;(39/2, 5/2, -1)\,&amp;lt;/math&amp;gt;, which composed with itself three times, with &amp;lt;math&amp;gt;m={7,11,9}&amp;lt;/math&amp;gt; respectively, when k becomes square and scaling can be applied, this gives &amp;lt;math&amp;gt;(1523/2, 195/2, 1)\,&amp;lt;/math&amp;gt;. Finally, such procedure can be repeated until the solution is found (requiring 9 additional self-compositions and 4 additional square-scalings): &amp;lt;math&amp;gt;(1766319049,\, 226153980,\, 1)&amp;lt;/math&amp;gt;. This is the minimal integer solution.&lt;br /&gt;
&lt;br /&gt;
===&amp;#039;&amp;#039;n&amp;#039;&amp;#039; = 67===&lt;br /&gt;
Suppose we are to solve &amp;lt;math&amp;gt;x^2 - 67y^2 = 1&amp;lt;/math&amp;gt; for &amp;#039;&amp;#039;x&amp;#039;&amp;#039; and &amp;#039;&amp;#039;y&amp;#039;&amp;#039;.&amp;lt;ref&amp;gt;The example in this section is given (with notation &amp;lt;math&amp;gt;Q_n&amp;lt;/math&amp;gt; for &amp;#039;&amp;#039;k&amp;#039;&amp;#039;, &amp;lt;math&amp;gt;P_n&amp;lt;/math&amp;gt; for &amp;#039;&amp;#039;m&amp;#039;&amp;#039;, etc.) in: {{citation | year=2009 | title = Solving the Pell equation | author1=Michael J. Jacobson | author2=Hugh C. Williams | publisher=Springer | isbn=978-0-387-84922-5 | page=31 | url=https://books.google.com/books?id=2INzqrEUGzAC&amp;amp;pg=PA31}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We start with a solution &amp;lt;math&amp;gt;a^2 - 67b^2 = k&amp;lt;/math&amp;gt; for any &amp;#039;&amp;#039;k&amp;#039;&amp;#039; found by any means; in this case we can let &amp;#039;&amp;#039;b&amp;#039;&amp;#039; be 1, thus producing &amp;lt;math&amp;gt;8^2 - 67\cdot1^2 = -3&amp;lt;/math&amp;gt;. At each step, we find an &amp;#039;&amp;#039;m&amp;#039;&amp;#039;&amp;amp;nbsp;&amp;gt;&amp;amp;nbsp;0 such that &amp;#039;&amp;#039;k&amp;#039;&amp;#039; divides &amp;#039;&amp;#039;a&amp;#039;&amp;#039;&amp;amp;nbsp;+&amp;amp;nbsp;&amp;#039;&amp;#039;bm&amp;#039;&amp;#039;, and |&amp;#039;&amp;#039;m&amp;#039;&amp;#039;&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;&amp;amp;nbsp;&amp;amp;minus;&amp;amp;nbsp;67| is minimal. We then update &amp;#039;&amp;#039;a&amp;#039;&amp;#039;, &amp;#039;&amp;#039;b&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;k&amp;#039;&amp;#039; to &amp;lt;math&amp;gt;\frac{am+Nb}{|k|}, \frac{a+bm}{|k|}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\frac{m^2-N}{k}&amp;lt;/math&amp;gt; respectively.&lt;br /&gt;
&lt;br /&gt;
;First iteration&lt;br /&gt;
We have &amp;lt;math&amp;gt;(a,b,k) = (8,1,-3)&amp;lt;/math&amp;gt;. We want a positive integer &amp;#039;&amp;#039;m&amp;#039;&amp;#039; such that &amp;#039;&amp;#039;k&amp;#039;&amp;#039; divides &amp;#039;&amp;#039;a&amp;#039;&amp;#039;&amp;amp;nbsp;+&amp;amp;nbsp;&amp;#039;&amp;#039;bm&amp;#039;&amp;#039;, i.e. 3 divides 8 + m, and |&amp;#039;&amp;#039;m&amp;#039;&amp;#039;&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;&amp;amp;nbsp;&amp;amp;minus;&amp;amp;nbsp;67| is minimal. The first condition implies that &amp;#039;&amp;#039;m&amp;#039;&amp;#039; is of the form 3&amp;#039;&amp;#039;t&amp;#039;&amp;#039; + 1 (i.e. 1, 4, 7, 10,… etc.), and among such &amp;#039;&amp;#039;m&amp;#039;&amp;#039;, the minimal value is attained for &amp;#039;&amp;#039;m&amp;#039;&amp;#039; = 7. Replacing (&amp;#039;&amp;#039;a&amp;#039;&amp;#039;,&amp;amp;nbsp;&amp;#039;&amp;#039;b&amp;#039;&amp;#039;,&amp;amp;nbsp;&amp;#039;&amp;#039;k&amp;#039;&amp;#039;) with &amp;lt;math&amp;gt;\left(\frac{am+Nb}{|k|}, \frac{a+bm}{|k|}, \frac{m^2-N}{k}\right)&amp;lt;/math&amp;gt;, we get the new values &amp;lt;math&amp;gt;a = (8\cdot7+67\cdot1)/3 = 41, b = (8 + 1\cdot7)/3 = 5, k = (7^2-67)/(-3) = 6&amp;lt;/math&amp;gt;. That is, we have the new solution:&lt;br /&gt;
: &amp;lt;math&amp;gt;41^2 - 67\cdot(5)^2 = 6.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point, one round of the cyclic algorithm is complete.&lt;br /&gt;
&lt;br /&gt;
;Second iteration&lt;br /&gt;
We now repeat the process. We have &amp;lt;math&amp;gt;(a,b,k) = (41,5,6)&amp;lt;/math&amp;gt;. We want an &amp;#039;&amp;#039;m&amp;#039;&amp;#039;&amp;amp;nbsp;&amp;gt;&amp;amp;nbsp;0 such that &amp;#039;&amp;#039;k&amp;#039;&amp;#039; divides &amp;#039;&amp;#039;a&amp;#039;&amp;#039;&amp;amp;nbsp;+&amp;amp;nbsp;&amp;#039;&amp;#039;bm&amp;#039;&amp;#039;, i.e. 6 divides 41&amp;amp;nbsp;+&amp;amp;nbsp;5&amp;#039;&amp;#039;m&amp;#039;&amp;#039;, and |&amp;#039;&amp;#039;m&amp;#039;&amp;#039;&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;&amp;amp;nbsp;&amp;amp;minus;&amp;amp;nbsp;67| is minimal. The first condition implies that &amp;#039;&amp;#039;m&amp;#039;&amp;#039; is of the form 6&amp;#039;&amp;#039;t&amp;#039;&amp;#039;&amp;amp;nbsp;+&amp;amp;nbsp;5 (i.e. 5, 11, 17,… etc.), and among such &amp;#039;&amp;#039;m&amp;#039;&amp;#039;, |&amp;#039;&amp;#039;m&amp;#039;&amp;#039;&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;&amp;amp;nbsp;&amp;amp;minus;&amp;amp;nbsp;67| is minimal for &amp;#039;&amp;#039;m&amp;#039;&amp;#039;&amp;amp;nbsp;=&amp;amp;nbsp;5. This leads to the new solution &amp;#039;&amp;#039;a&amp;#039;&amp;#039;&amp;amp;nbsp;=&amp;amp;nbsp;(41⋅5&amp;amp;nbsp;+&amp;amp;nbsp;67⋅5)/6, etc.:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;90^2 - 67 \cdot 11^2 = -7.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Third iteration&lt;br /&gt;
For 7 to divide 90 + 11&amp;#039;&amp;#039;m&amp;#039;&amp;#039;, we must have &amp;#039;&amp;#039;m&amp;#039;&amp;#039; = 2&amp;amp;nbsp;+&amp;amp;nbsp;7&amp;#039;&amp;#039;t&amp;#039;&amp;#039; (i.e. 2, 9, 16,… etc.) and among such &amp;#039;&amp;#039;m&amp;#039;&amp;#039;, we pick &amp;#039;&amp;#039;m&amp;#039;&amp;#039; = 9.&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;221^2 - 67\cdot 27^2 = -2.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Final solution&lt;br /&gt;
At this point, we could continue with the cyclic method (and it would end, after seven iterations), but since the right-hand side is among ±1, ±2, ±4, we can also use Brahmagupta&amp;#039;s observation directly. Composing the triple (221, 27, &amp;amp;minus;2) with itself, we get&lt;br /&gt;
:&amp;lt;math&amp;gt; \left(\frac{221^2 + 67\cdot27^2}{2}\right)^2 - 67\cdot(221\cdot27)^2 = 1,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
that is, we have the integer solution:&lt;br /&gt;
:&amp;lt;math&amp;gt; 48842^2 - 67 \cdot 5967^2 = 1.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This equation approximates &amp;lt;math&amp;gt;\sqrt{67}&amp;lt;/math&amp;gt;  as  &amp;lt;math&amp;gt; \frac{48842}{5967}&amp;lt;/math&amp;gt; to within a margin of about &amp;lt;math&amp;gt; 2 \times 10^{-9}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
{{Reflist}}&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*[[Florian Cajori]] (1918), Origin of the Name &amp;quot;Mathematical Induction&amp;quot;, &amp;#039;&amp;#039;[[The American Mathematical Monthly]]&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;25&amp;#039;&amp;#039;&amp;#039; (5), p.&amp;amp;nbsp;197-201.&lt;br /&gt;
*George Gheverghese Joseph, &amp;#039;&amp;#039;[[The Crest of the Peacock: Non-European Roots of Mathematics]]&amp;#039;&amp;#039; (1975).&lt;br /&gt;
*G. R. Kaye, &amp;quot;Indian Mathematics&amp;quot;, &amp;#039;&amp;#039;Isis&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;2&amp;#039;&amp;#039;&amp;#039;:2 (1919), p.&amp;amp;nbsp;326–356.&lt;br /&gt;
*Clas-Olaf Selenius, [http://www.msc.uky.edu/sohum/ma330/files/Rationale-of-the-chakrav-la-process-of-Jayadeva-and-Bh-skara-II_1975_Historia-Mathematica.pdf &amp;quot;Rationale of the chakravala process of Jayadeva and Bhaskara II&amp;quot;], &amp;#039;&amp;#039;Historia Mathematica&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;2&amp;#039;&amp;#039;&amp;#039; (1975), pp.&amp;amp;nbsp;167–184.&lt;br /&gt;
*Clas-Olaf Selenius, &amp;quot;Kettenbruchtheoretische Erklärung der zyklischen Methode zur Lösung der Bhaskara-Pell-Gleichung&amp;quot;, &amp;#039;&amp;#039;Acta Acad. Abo. Math. Phys.&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;23&amp;#039;&amp;#039;&amp;#039; (10) (1963), pp.&amp;amp;nbsp;1–44.&lt;br /&gt;
*Hoiberg, Dale &amp;amp; Ramchandani, Indu (2000). &amp;#039;&amp;#039;Students&amp;#039; Britannica India&amp;#039;&amp;#039;. Mumbai: Popular Prakashan. {{isbn|0-85229-760-2}}&lt;br /&gt;
*Goonatilake, Susantha (1998). &amp;#039;&amp;#039;Toward a Global Science: Mining Civilizational Knowledge&amp;#039;&amp;#039;. Indiana: Indiana University Press. {{isbn|0-253-33388-1}}.&lt;br /&gt;
*Kumar, Narendra (2004). &amp;#039;&amp;#039;Science in Ancient India&amp;#039;&amp;#039;. Delhi: Anmol Publications Pvt Ltd. {{isbn|81-261-2056-8}}&lt;br /&gt;
*Ploker, Kim (2007) &amp;quot;Mathematics in India&amp;quot;. &amp;#039;&amp;#039;The Mathematics of Egypt, Mesopotamia, China, India, and Islam: A Sourcebook&amp;#039;&amp;#039; New Jersey: Princeton University Press. {{isbn|0-691-11485-4}}&lt;br /&gt;
*{{cite book&lt;br /&gt;
  | last = Edwards&lt;br /&gt;
  | first = Harold&lt;br /&gt;
  | title = Fermat&amp;#039;s Last Theorem&lt;br /&gt;
  | publisher = [[Springer Science+Business Media|Springer]]&lt;br /&gt;
  | location = New York&lt;br /&gt;
  | date = 1977&lt;br /&gt;
  | isbn = 0-387-90230-9}}&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*[https://web.archive.org/web/20110707120031/http://www-groups.dcs.st-and.ac.uk/~history/Miscellaneous/Pearce/Lectures/Ch8_6.html Introduction to chakravala]&lt;br /&gt;
&lt;br /&gt;
{{number theoretic algorithms}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Brahmagupta]]&lt;br /&gt;
[[Category:Diophantine equations]]&lt;br /&gt;
[[Category:Number theoretic algorithms]]&lt;br /&gt;
[[Category:Indian mathematics]]&lt;/div&gt;</summary>
		<author><name>&gt;WikiCleanerBot</name></author>
	</entry>
</feed>