[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference rusure::math

Title:Mathematics at DEC
Moderator:RUSURE::EDP
Created:Mon Feb 03 1986
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2083
Total number of notes:14613

486.0. "The New Method (Square roots, Continued Fractions)" by SIERRA::OSMAN (and silos to fill before I feep, and silos to fill before I feep) Fri May 09 1986 19:17

    Many rational numbers represented as regular continued fractions
    start looking quite rational.
    
    First, a definition, regular continued fraction:
    
    	r = a+1/(b+1/(c+1/ . . .
    
    This is often written as:
    
    	r = [a b c d . . .]
    
    For example, e=2.718281828459045 . . ., which looks quite irrational.
    
    However, write it as a regular continued fraction and it becomes
    quite rational:
    
    	e = [2 1 2 1 1 4 1 1 6 1 1 8 1 1 10 1 1 12 1 . . .]
    
    Square roots are quite "rational" too:
    
    	sqr(2) = [1 2 2 2 2 2 . . .]
    
    	sqr(3) = [1 1 2 1 2 1 2 . . .]
    
    	sqr(5) = [2 4 4 4 4 4 4 4 . . .]
    
    	sqr(6) = [2 2 4 2 4 2 4 2 4 2 4 . . .]
    
    	sqr(7) = [2 1 1 1 4 1 1 1 4 1 1 1 4 . . .]
    
    	sqr(8) = [2 1 4 1 4 1 4 1 4 1 4 . . .]
    
    Not all irrational numbers come out rational as continued fractions,
    however.  In this sense, might might say PI is less rational than
    e.
    
    	pi = [3 7 15 1 185 . . .]
    
    A useful provable result of regular continued fraction representation
    is that using the first n terms of the fraction gives best
    rational approximations.  For instance, using 22/7 for pi is
    mrely [3 7].  355/113 is quite accurate, and is merely
    [3 7 15].
    
    Some questions:
    
    o	What is sqr(79)'s continued fraction ?
    
    o	Prove that all square roots of rationals are "rational"
    	regular continued fractions.  What about square roots
    	of irrationals ?  What about cube roots ?
    
    o	Observe that a number of integers have repeated patterns in
    	their square root continued fraction representation
    	comprising a partition of the integer.  For instance,
    	1+2=3, 2+4=6, 1+1+1+4=7.  What set of integers is this
    	generally true for ?
    
    o	Is there a way to compute the regular continued fraction
    	for sqr(n) without really "doing" it ?
    
    o	Can we work backwards ?  For instance, what is the closed
    	form for [2 1 1 4 1 1 4 1 1 4 . . .].  What can we say
    	in general about [i <j1 j2 . . . jn> <j1 j2 . . . jn> . . .]
    	in closed form ?
    
    By the way, here's my program for giving glimpses of the fractions,
    in BASIC:
    
2 l = 10	! number of terms to print, only about 6 are accurate
5 c = 1
10 r = 3.1415926	! number to analyze
20 d = int (r)
30 print d
40 r = 1/(r-d)
45 c = c + 1
50 if c < l then goto 20
    
Have a good weekend !
    
    /Eric
T.RTitleUserPersonal
Name
DateLines
486.1ENGINE::ROTHFri May 09 1986 23:1530
    In any continued fraction that repeats you'll get an expression of the
    form x = [i j k l m n ... + 1/x]; if you expand any expression of this
    type out, you always have x = T(x) = (a*x + b)/(c*x + d), and the
    solution for the fixed point of this transform is never worse than a
    quadratic.  You can also turn this around and solve any quadratic
    by expressing it in terms of a regular continued fraction.

    For example, you can always get a root of N by picking the nearest
    integer root and expressing a recurrance, as in the SQRT(79) example.

    Quadratic surds are the only continued fractions that have periodic
    expansions.

    Consider a filament in the plane stretched from the origin to a point
    far away, with an irrational slope.  If you pull it away from the origin
    it will meet lattice points that are successive convergents of the
    CF expansion of its slope.

    Continued fraction type expansions occur in some other interesting
    contexts.  For example, if you want to color in a regular tiling
    of the non-Euclidean plane, you can express it in terms of combinations
    of 'inversions' with respect to a circle, and rotations about a fixed
    point; these operations can effectively replicate copies of some
    region throughout the plane, and basically generate the group of all
    motions possible.  Writing down the sequence of transforms shows that
    they are just like a continued fraction, with inversion corresponding
    to taking a reciprocal, etc, and you can get a group theoretic/geometric
    analog to number theory concepts.

    - Jim
486.2solution to sqrt(79)'s continued fraction . . .7480::KOSTASKostas G. Gavrielidis &lt;o.o&gt; Sat May 24 1986 22:2985
    re. .0
    
    This is the solution to the question:
    
    What is the sqrt(79)'s continued fraction ?
    
    
    Since the greatest inter of  [sqrt(70)] = 8 and

        (sqrt(79) - 8) * (sqrt(79) + 8 ) = 15

    we have
    
    sqrt(79) = 8 + (sqrt(79) - 8)
    
    
                        15
             = 8 + ------------
                   8 + sqrt(79)
    
    
                        1
             = 8 + ---------------
                   8 + sqrt(79)
                   ------------
                        15

    
                            1
             = 8 + ----------------
                       sqrt(79) - 8
                   1 + ------------
                            15

        
                           1
             = 8 + ----------------
                             1
                   1 + ------------
                       8 + sqrt(79)
    
    
                          1
             = 8 + ----------------
                            1
                   1 + ------------
                       8 + sqrt(79)
    
    
                               1
             = 8 + --------------------------
                                 1
                   1 + ----------------------
                                    15
                       8 + (8 + ------------)
                                8 + sqrt(79)
    
    
                               1
             = 8 + --------------------------
                                 1
                   1 + ----------------------
                                 15
                       16 + (------------)
                             8 + sqrt(79)
    
             = . . .
    
                   _____
             = <8, 1, 16>

    
    which in your notation is:  
    
         sqrt(79) = [8 1 16 1 16 1 16 . . .]
    
    
    
    I would like to remind anyone interested in the continued fractions
    to also look up on this notes file note # 483.*
    
    Enjoy,
    
    Kostas G.
    <><><><><>
486.3solution to [2 1 1 4 1 1 4 1 1 4 . . .] problem7480::KOSTASKostas G. Gavrielidis &lt;o.o&gt; Sat May 24 1986 23:43135
re. 486.0

This is a reply to a problem raised in this notes file node# 486.0
and is related to continued fractions problems.


The problem was this:

    "Can we work backwards ? For instance, what is the closed
    form for [2 1 1 4 1 1 4 1 1 4 . . .]."


The answer is:

Yes. And the closed form for [2 1 1 4 1 1 4 1 1 4 . . .] follows.
Since I have used a different notation in the problems related to
continued fraction in the note # 483.0, I will try to satisfy both
of us ( Eric and Kostas).

So,

    let 

        x = [2 1 1 4 1 1 4 1 1 4 . . .]

    or
               _____                      1
        x = <2 1 1 4>   =  2 + ------------------------
                                             1
                               1 + --------------------
                                               1
                                   1 + ----------------
                                                  1
                                       4 + ------------
                                                    
                                           1 + . . .

    then

                                          1
        x -  2          =      ------------------------
                                             1
                               1 + --------------------
                                               1
                                   1 + ----------------
                                                  1
                                       4 + ------------
                                                    
                                           1 + . . .


                                          1
                        =      ------------------------
                                             1
                               1 + --------------------
                                               1
                                   1 + ----------------
                                       4 + (x - 2 )

                                          1
                        =      ------------------------
                                             1
                               1 + --------------------
                                               1
                                   1 + ----------------
                                           (x + 2 )


                                          1
                        =      ------------------------
                                             1
                               1 + --------------------
                                         (x + 3)
                                       ------------
                                         (x - 2 )


                                          1
                        =      ------------------------
                                        2x + 5
                                      -----------
                                        (x + 3)


                                        (x + 3)
                        =             -----------
                                        2x + 5


     Thus

          (x + 4)(2x + 5) = x + 3

            2
          2x  + 5x + 8x + 20 = x + 3

            2
          2x  + 12x + 17 = 0

                                 2
              -12 + or - sqrt( 12  - 4 * 2 * 17)
          x = ----------------------------------
                              4

              -12 + or -  sqrt(8)
            = -----------------------
                        4

    since 

           [(-6 + sqrt(8))/2] = -2

       and 

           [(-6 - sqrt(8))/2] = -4 

    we can conclude that

       
               _______     -6 - sqrt(8)
       x = <2, 1, 1, 4> = ---------------
                                2


    or
       
                                       -6 - sqrt(8)
       [2 1 1 4 1 1 4 1 1 4 . . .]  = ---------------
                                             2


Enjoy,

Kostas G.
<><><><><>
486.4... but it's wrong ...METOO::YARBROUGHTue May 27 1986 16:504
    And this solution, like the one in the other note, is wrong. There
    is a typo early in the calculation.
    
    MAPLE does this sort of thing very nicely (and correctly).
486.5Correct solution of <2, 1, 1, 4> is on note 483.8THEBUS::KOSTASKostas G. Gavrielidis &lt;o.o&gt; Sun Jun 01 1986 00:5913
    re. .4
    
    I have fixed the bug please read note 483.8 for the corrected solution.
    
    I would like to see the output of MAPLE. I have never used this
    tool before, so could you provide some examples or a reference to
    where I can get info on this MAPLE tool.
    
    Thanks,
    
    Kostas G.
    
    
486.6See 439METOO::YARBROUGHMon Jun 02 1986 12:521
    see note 439 for info on MAPLE.
486.7some of these look a lot alikeMETOO::YARBROUGHMon Jun 02 1986 12:593
    I may have miscounted 1's in an earlier reply. The continued fraction
    for 6.5^.5 is [2,1,1,4,1,1,4,...], while 
    for 7^.5 it is [2,1,1,1,4,1,1,1,4...].
486.8Find f(n) = [2,{n 1's, 4}]ROXIE::OSMANand silos to fill before I feep, and silos to fill before I feepMon Jun 02 1986 14:4110


o.k., so [2,{1,1,4}] is sqr(6.5) and
	 [2,{1,1,1,4}] is sqr(7).

What about [2,{n 1's, 4}] is f(n) ?  Can anyone find a correct
function ?

/Eric
486.9looks like the interval [6^.5, 8^.5] = <2,{n 1's,4}>THEBUS::KOSTASKostas G. Gavrielidis &lt;o.o&gt; Tue Jun 03 1986 12:4140
    Well,
    
        what we have as of now:
    
                          ____
            6^.5    = <2, 2, 4>

                          _______
            6.5^.5  = <2, 1, 1, 4>     and 6.5^.5 = 2.5495098
    
    
            -5 + (433)^.5        _____________
            -------------- = <2, 1, 1, 1, 1, 4>     
                  6
    
                              and (-5 + 433^.5)/6 = 2.6347753
    
                          __________
            7^.5    = <2, 1, 1, 1, 4>  and   7^.5 = 2.6457513
    
    
            8^.5    = <2, 1, 4>        and   8^.5 = 2.8284271
    

            This looks like we have the interval 
    
            from:  > 6^.5
              to:    8^.5
    
                (6^.5, 8^.5]
    

            Still no function  f(n) available yet.
    
    Enjoy,
    
    Kostas G.        
    
    
            
486.10More data on this particular class of C.f.'sMETOO::YARBROUGHTue Jun 03 1986 14:0315
    There appears to be a calculation error in the previous reply. Let
    K(n) be the continued fraction with 2 as first term and n 1's preceding
    a 4 as the repeating cycle after that. Then
    
    K(0) = sqr(5)
    K(1) = sqr(8)=2sqr(2)
    K(2) = sqr(26)/2
    K(3) = sqr(7)
    K(4) = sqr(170)/5
    K(5) = sqr(110)/4
    K(6) = sqr(1157)/13
    K(7) = 4sqr(21)/7
    K(8) = sqr(7922)/34
    (I leave the rest as an exercise for the reader :-))
    Thanks, MAPLE.
486.11a.k.a. fie, "Osman's Constant"AURORA::HALLYBFree the quarks!Tue Jun 03 1986 15:237
    Lynn, would you or MAPLE happen to have decimal expansions of the
    preceding values?
    
    Given that  phi = [1,1,1,1,1,1,1,1,.....] = (1+sqrt(5))/2 ~= 1.618034,
    I would conjecture that [2,1,1,1,1,...,4] = (3+sqrt(5))/2 in the limit.

      John
486.12CLT::GILBERTOn the road again...Wed Jun 04 1986 00:0629
486.13PI - continued fractionCADSYS::PRENTICEEd 225-4061 HLO2-2/G13 (E13)Tue Jun 23 1987 18:1913
>  < Note 486.0 by SIERRA::OSMAN  >
>             -< The New Method (Square roots, Continued Fractions) >-
> 
>     Not all irrational numbers come out rational as continued fractions,
>     however.  In this sense, might might say PI is less rational than e.
>     
>     	pi = [3 7 15 1 185 . . .]

    Since the regular continued fraction for PI is irregular, Does anyone
    have any ideas on an efficient means of calculating the terms of PI from
    some other values in continued fraction format (or a way to produce the
    terms directly)? 
/egp
486.14That 5th term is off a bitAKQJ10::YARBROUGHWhy is computing so labor intensive?Tue Jun 23 1987 20:099
MAPLE will produce the continued fractions for Pi out a ways. The first 20 
terms are:

Pi ~ [3, 7, 15, 1, 292, 1, 1, 1, 2, 1, 3, 1, 14, 2, 1, 1, 2, 2, 2, 2, ...]

You can also get the convergents (i.e. rational approximations) as a side
effect. 

Lynn Yarbrough 
486.15CLT::GILBERTeager like a childWed Jun 24 1987 04:527
486.16ENGINE::ROTHWed Jun 24 1987 12:3712
    Re continued fraction for PI;  I think Gosper has the record for number
    of terms calculated so far, millions of them, on a Symbolics workstation.

    I don't know the method he used.  However, I *just* got a neat new
    recreational math book called PI and the AGM, by Borwien and Borwien.
    Haven't really looked thru it yet, but it probably has an algorithm
    for this.  

    This book is chock full of neat number theory, elliptic function theory,
    and computational mathematics...

    - Jim