Can anyone show me how to find the solutions to $x^2-6y^2=1$ by using continued fractions? I know how to find the fractions for $\sqrt6$ but do not know how to proceed. THANK YOU!!!

- 26,355

- 117
-
1$x=1, y=0$ would satisfy – SalmonKiller May 26 '15 at 19:10
-
1See the answers here. – Dietrich Burde May 26 '15 at 19:11
-
Yeah but there exist some other non-trivial solutions where x and y are both positive integers – Keyang Zhang May 26 '15 at 19:11
-
See also: http://math.stackexchange.com/questions/555179/pells-equation-through-continued-fractions – Martin Sleziak Jun 21 '16 at 08:50
2 Answers
The easiest way is to guess one positive solution, namely in this case, $(x,y) = (5,2)$. This happens to be the smallest positive solution as well. Once this is done, use Brahmagupta's identity to construct more solutions.

- 20,259
Suppose you are able to find a solution to $x^2-6y^2=1$ like $u_1=5$ and $v_1=2$ as indicated in the answer given by user17762. Then ALL other positive integer solutions $(u_n,v_n)$ can be found by $$u_n+\sqrt{6}v_n=(u_1+\sqrt{6}v_1)^n.$$ Thus another solution will be $$u_2+\sqrt{6}v_2=(u_1+\sqrt{6}v_1)^2=(5+2\sqrt{6})^2=49+20\sqrt{6}.$$
In general, you can get a recurrence relation as follows: $$u_n+\sqrt{6}v_n=(u_{n-1}+\sqrt{6}v_{n-1})(u_1+\sqrt{6}v_1)=(u_{n-1}+\sqrt{6}v_{n-1})(5+2\sqrt{6}).$$ Upon comparison you get: \begin{align*} u_n & = 5u_{n-1}+12v_{n-1}\\ v_n & = 2u_{n-1}+5v_{n-1} \end{align*} This is exactly the recurence relation satisfied by the convergents of the continued fraction of $\sqrt{6}$.

- 41,067
-
Thank you so much!! What if the right hand side of the equation is -1? How should I compute the second solution in that case? Thank you a lot – Keyang Zhang May 26 '15 at 19:49
-
@KeyangZhang for $x^2-6y^2=-1$, you first find a solution $(a,b)$ for it and then use the solutions $(u_n,v_n) $for $x^2-6y^2=+1$ to find other solutions for the first equation by using $(a+b\sqrt{6})(u_n+v_n\sqrt{6})$. – Anurag A May 26 '15 at 19:52