Last term of repeating continued fraction expansion - MathOverflow most recent 30 from http://mathoverflow.net 2013-05-23T10:05:44Z http://mathoverflow.net/feeds/question/106217 http://www.creativecommons.org/licenses/by-nc/2.5/rdf http://mathoverflow.net/questions/106217/last-term-of-repeating-continued-fraction-expansion Last term of repeating continued fraction expansion Jack Huizenga 2012-09-03T04:19:50Z 2012-09-03T06:00:04Z <p>Once again, working with stable vector bundles on $\mathbb{P}^2$ I have run into a question that is really out of my area. (Thanks to everybody who helped out with my last question!)</p> <p>Let $D>9$ be a rational number which is not a square, and consider the quadratic irrational </p> <p>$$\xi = \frac{-3 + \sqrt{D}}{2},$$</p> <p>(I'd be willing to force $D$ to be an integer, and even to assume $D \equiv 5 \pmod{8}$, but I don't think it matters). Let $r$ be the positive integer such that </p> <p>$$(2r+1)^2 &lt; D &lt; (2r+3)^2.$$</p> <p>Numerous examples with Mathematica suggest that the continued fraction expansion of $\xi$ takes the form </p> <p>$$\xi = [r-1;\overline{a_1,\ldots,a_k}],$$ where the last term of the repeating part is $a_k = 2r+1$. </p> <p>For my particular situtation, I'd be happy enough to know that the number $2r+1$ appears somewhere in the expansion.</p> <p>As I know almost nothing about continued fractions aside from statements of the basic results, I haven't the slightest idea how to prove something like this. I also don't have a source which does much more advanced things than show that the expansion of a quadratic irrational always repeats. Are statements like this well-known? And where should I look for more advanced theory relevant to this problem?</p> <p>In case it helps, the original form I came to this number is as follows. Put $$q = \frac{1}{8}(D-5).$$ Then $\xi$ is a solution of the equation $$\frac{1}{2}(x^2+3x+1) = q.$$ Thanks!</p> <p>EDIT: At request, here is what Mathematica gives for the continued fractions for some $D$:</p> <p>$D=5: [0;-2,\overline{-1}]$ (but I am requiring $D>9$)</p> <p>$D=10: [0;\overline{12,3}]$</p> <p>$D=13: [0;\overline{3}]$</p> <p>$D=141: [4;\overline{2,3,2,11}]$</p> <p>(need more examples? Just ask!)</p> http://mathoverflow.net/questions/106217/last-term-of-repeating-continued-fraction-expansion/106219#106219 Answer by Henry Cohn for Last term of repeating continued fraction expansion Henry Cohn 2012-09-03T05:28:32Z 2012-09-03T05:28:32Z <p>It's known that a quadratic irrational has a purely periodic continued fraction expansion if and only if it is greater than $1$ and its conjugate is between $-1$ and $0$. Your observation amounts to proving that $r+2 + (-3+\sqrt{D})/2$ has this property (note that adding $r+2$ makes it start with $2r+1$). That amounts to checking that $-1 &lt; (2r+1 - \sqrt{D})/2 &lt; 0$, which is equivalent to your assumption that $(2r+1)^2 &lt; D &lt; (2r+3)^3$.</p> http://mathoverflow.net/questions/106217/last-term-of-repeating-continued-fraction-expansion/106220#106220 Answer by Will Jagy for Last term of repeating continued fraction expansion Will Jagy 2012-09-03T05:44:37Z 2012-09-03T06:00:04Z <p>EDIT: I got your fact right here.</p> <p>ORIGINAL: It seems Henry got it. Meanwhile, let me point out how things appear from the Lagrange viewpoint of right-adjacent reduced forms: given odd numbers $n$ and $1 \leq m \leq n,$ the cycle for the form $\langle -1, n, m \rangle$ has penultimate form $\langle m, n, -1 \rangle,$ then "digit" $\delta = -n,$ then the end of the cycle is again $\langle -1, n, m \rangle .$ Well, see the method in my answer at <a href="http://mathoverflow.net/questions/22811/upper-bound-of-period-length-of-continued-fraction-representation-of-very-composi" rel="nofollow">http://mathoverflow.net/questions/22811/upper-bound-of-period-length-of-continued-fraction-representation-of-very-composi</a> where the fact you need, the final $\delta = -n,$ follows from the definition of the $\delta$'s. </p> <p>Examples: </p> <pre><code>========================================= jagy@phobeusjunior:~/old drive/home/jagy/Cplusplus$./indefCycle Input three coefficients a b c for indef f(x,y)= a x^2 + b x y + c y^2 -1 5 1 0 form -1 5 1 1 0 0 1 To Return 1 0 0 1 0 form -1 5 1 delta 5 1 form 1 5 -1 delta -5 2 form -1 5 1 minimum was 1rep 1 0 disc 29 dSqrt 5.3851648071 M_Ratio 29 Automorph, written on right of Gram matrix: -1 5 5 -26 Trace: -27 gcd(a21, a22 - a11, a12) : 5 ========================================= jagy@phobeusjunior:~/old drive/home/jagy/Cplusplus$ ./indefCycle Input three coefficients a b c for indef f(x,y)= a x^2 + b x y + c y^2 -1 5 3 0 form -1 5 3 1 0 0 1 To Return 1 0 0 1 0 form -1 5 3 delta 1 1 form 3 1 -3 delta -1 2 form -3 5 1 delta 5 3 form 1 5 -3 delta -1 4 form -3 1 3 delta 1 5 form 3 5 -1 delta -5 6 form -1 5 3 minimum was 1rep 1 0 disc 37 dSqrt 6.0827625303 M_Ratio 37 Automorph, written on right of Gram matrix: -13 72 24 -133 Trace: -146 gcd(a21, a22 - a11, a12) : 24 ========================================= jagy@phobeusjunior:~/old drive/home/jagy/Cplusplus$./indefCycle Input three coefficients a b c for indef f(x,y)= a x^2 + b x y + c y^2 -1 5 5 0 form -1 5 5 1 0 0 1 To Return 1 0 0 1 0 form -1 5 5 delta 1 1 form 5 5 -1 delta -5 2 form -1 5 5 minimum was 1rep 1 0 disc 45 dSqrt 6.7082039325 M_Ratio 45 Automorph, written on right of Gram matrix: -1 5 1 -6 Trace: -7 gcd(a21, a22 - a11, a12) : 1 ========================================= jagy@phobeusjunior:~/old drive/home/jagy/Cplusplus$ ./indefCycle Input three coefficients a b c for indef f(x,y)= a x^2 + b x y + c y^2 -1 7 1 0 form -1 7 1 1 0 0 1 To Return 1 0 0 1 0 form -1 7 1 delta 7 1 form 1 7 -1 delta -7 2 form -1 7 1 minimum was 1rep 1 0 disc 53 dSqrt 7.2801098893 M_Ratio 53 Automorph, written on right of Gram matrix: -1 7 7 -50 Trace: -51 gcd(a21, a22 - a11, a12) : 7 ========================================= jagy@phobeusjunior:~/old drive/home/jagy/Cplusplus$./indefCycle Input three coefficients a b c for indef f(x,y)= a x^2 + b x y + c y^2 -1 7 3 0 form -1 7 3 1 0 0 1 To Return 1 0 0 1 0 form -1 7 3 delta 2 1 form 3 5 -3 delta -2 2 form -3 7 1 delta 7 3 form 1 7 -3 delta -2 4 form -3 5 3 delta 2 5 form 3 7 -1 delta -7 6 form -1 7 3 minimum was 1rep 1 0 disc 61 dSqrt 7.8102496759 M_Ratio 61 Automorph, written on right of Gram matrix: -79 585 195 -1444 Trace: -1523 gcd(a21, a22 - a11, a12) : 195 ========================================= jagy@phobeusjunior:~/old drive/home/jagy/Cplusplus$ ./indefCycle Input three coefficients a b c for indef f(x,y)= a x^2 + b x y + c y^2 -1 7 5 0 form -1 7 5 1 0 0 1 To Return 1 0 0 1 0 form -1 7 5 delta 1 1 form 5 3 -3 delta -1 2 form -3 3 5 delta 1 3 form 5 7 -1 delta -7 4 form -1 7 5 minimum was 1rep 1 0 disc 69 dSqrt 8.3066238629 M_Ratio 69 Automorph, written on right of Gram matrix: 2 -15 -3 23 Trace: 25 gcd(a21, a22 - a11, a12) : 3 ========================================= jagy@phobeusjunior:~/old drive/home/jagy/Cplusplus$./indefCycle Input three coefficients a b c for indef f(x,y)= a x^2 + b x y + c y^2 -1 7 7 0 form -1 7 7 1 0 0 1 To Return 1 0 0 1 0 form -1 7 7 delta 1 1 form 7 7 -1 delta -7 2 form -1 7 7 minimum was 1rep 1 0 disc 77 dSqrt 8.7749643874 M_Ratio 77 Automorph, written on right of Gram matrix: -1 7 1 -8 Trace: -9 gcd(a21, a22 - a11, a12) : 1 ========================================= jagy@phobeusjunior:~/old drive/home/jagy/Cplusplus$ </code></pre>