1

In order to show the positive root of a quadratic equation in Simple Continued Fractions I map the quadratic equation like;

$cx^2+(d−a)x−b=0\implies x=\frac{ax+b}{cx+d}$

where $a > c$ or perhaps $a>d$.

I believe this tells me that the positive root is somewhere between $\frac{a}{c}$ and $\frac{b}{d}$. I can assign it's average to $x$ to check if the floor of what i get is equal to $x$ or not. If not i can iterate over with the obtained result until their integer parts are equal but perhaps there is a better way.

On the other hand, I can of course go backwards to apply quadratic formula and floor it however it beats the purpose. I just want to know if there might be a shortcut from $x=\frac{ax+b}{cx+d}$

I tried $⌊\frac{a}{c}−(\frac{d}{c}−\frac{b}{a})⌋$ but i fails in some cases.

Redu
  • 231
  • 1
    I think you'd better include some numerical examples. Especially why you mention continued fractions... – Will Jagy Mar 07 '22 at 18:35
  • @WillJagyHere you can see an application where $\lfloor\frac{a}{c} - (\frac{d}{c} - \frac{b}{a})\rfloor$ worked just fine but it fails in general. – Redu Mar 07 '22 at 18:55
  • I have code for the Gauss-Lagrange method for what you want. This applies directly when you have indefinite $a x^2 + b x + c = 0$ when $ac < 0.$ Please give me a few problem you like, I can make an answer of sorts – Will Jagy Mar 07 '22 at 18:58
  • @WillJagy I expect $0$ for $x=\frac{24x+69}{74x+47}$ – Redu Mar 07 '22 at 19:42
  • well, if you want the positive root of $74 x^2 + 23 x - 69,$ the "digits" begin [0,1,4,1,1,1,3... Is that what you want? – Will Jagy Mar 07 '22 at 19:58
  • @WillJagy If i can formulate a safe but simple way to figure out the initial $0$ to start with, the rest is easy. That's exactly what i am asking. – Redu Mar 07 '22 at 20:04
  • But your form is reduced: $ 74 \cdot (-69) < 0 $ and $23 > |74-69| $ – Will Jagy Mar 07 '22 at 20:07

1 Answers1

0

got to make a phone call

jagy@phobeusjunior:~/old drive/home/jagy/Cplusplus$ ./indefCycle 74 23 -69

0 form 74 23 -69

       1           0
       0           1

To Return
1 0 0 1

0 form 74 23 -69 delta -1 1 form -69 115 28 delta 4 2 form 28 109 -81 delta -1 3 form -81 53 56 delta 1 4 form 56 59 -78 delta -1 5 form -78 97 37 delta 3 6 form 37 125 -36 delta -3 7 form -36 91 88 delta 1 8 form 88 85 -39 delta -2 9 form -39 71 102 delta 1 10 form 102 133 -8 delta -17 11 form -8 139 51 delta 2 12 form 51 65 -82 delta -1 13 form -82 99 34 delta 3 14 form 34 105 -73 delta -1 15 form -73 41 66 delta 1 16 form 66 91 -48 delta -2 17 form -48 101 56 delta 2 18 form 56 123 -26 delta -5 19 form -26 137 21 delta 6 20 form 21 115 -92 delta -1 21 form -92 69 44 delta 2 22 form 44 107 -54 delta -2 23 form -54 109 42 delta 3 24 form 42 143 -3 delta -47 25 form -3 139 136 delta 1 26 form 136 133 -6 delta -23 27 form -6 143 21 delta 6 28 form 21 109 -108 delta -1 29 form -108 107 22 delta 5 30 form 22 113 -93 delta -1 31 form -93 73 42 delta 2 32 form 42 95 -71 delta -1 33 form -71 47 66 delta 1 34 form 66 85 -52 delta -2 35 form -52 123 28 delta 4 36 form 28 101 -96 delta -1 37 form -96 91 33 delta 3 38 form 33 107 -72 delta -1 39 form -72 37 68 delta 1 40 form 68 99 -41 delta -2 41 form -41 65 102 delta 1 42 form 102 139 -4 delta -35 43 form -4 141 67 delta 2 44 form 67 127 -18 delta -7 45 form -18 125 74 delta 1 46 form 74 23 -69

form 74 x^2 + 23 x y -69 y^2

minimum was 3rep x = 2037246618 y = 2476457963 disc 20953 dSqrt 144 M_Ratio 3.786706 Automorph, written on right of Gram matrix:
-176678757708873898919 -200257625715180256080

-214769047868454187680 -243431299613933984279

Will Jagy
  • 139,541