Cotiued Fractios of Quadratic Numbers L ubomíra Balková Araka Hrušková arxiv:0.05v [math.co] Feb 0 February 5 0 Abstract I this paper we will first summarize kow results cocerig cotiued fractios. The we will limit our cosideratio to cotiued fractios of quadratic umbers. The secod author described periods ad sometimes precise form of cotiued fractios of N where N is a atural umber. I cases where we were able to fid such results i literature we recall the origial authors however may results seem to be ew. Itroductio Cotiued fractios have a log history behid them - their origi may be placed to the age of Euclid s algorithm for the greatest commo divisor or eve earlier. However they experiece a revival owadays thaks to their applicatios i high-speed ad high-accuracy computer arithmetics. Some of the advatages of cotiued fractios i computer arithmetics are: faster divisio ad multiplicatio tha with positioal umber represetatios fast ad precise evaluatio of trigoometric logarithmic ad other fuctios precise represetatio of trascedetal umbers o roudoff or trucatio errors ([6] Kaha s method i [] page 79). Cotiued fractios Here are some basic defiitios ad results that ca be foud i ay umber theory course [ ]. We use x to deote the iteger part of a real umber x. Defiitio. The cotiued fractio (expasio) of a real umber x is the sequece of itegers (a ) N obtaied by the followig algorithm x 0 = x a = x x = { x a if x Z 0 otherwise. Note that a 0 Z ad a N. The algorithm producig the cotiued fractio is closely related to the Euclidea algorithm for computig the greatest commo divisor of two itegers. It is thus readily see that if the umber x is ratioal the algorithm evetually produces zeroes i.e. there exists N N such that a = 0 for all > N thus x = a 0. () a a... a N a N
We write x = [a 0... a N ]. O the other had if we wat to fid a expressio of the form () with a 0 Z ad a N \ {0} otherwise the there are exactly two of them the cotiued fractio [a 0... a N ] ad x = a 0 a a... a N. (a N ) If the umber x is irratioal the the sequece of the so-called covergets a 0 a 0... a 0 a a a... a a () coverges to x for. O the other had every sequece of ratioal umbers of the form () with a 0 Z ad a N \ {0} coverges to a irratioal umber (ad for every irratioal umber there is oly oe such sequece the sequece of covergets). We write x = [a 0... a... ]. The covergets of the cotiued fractio are kow to represet irratioal umbers better tha ay other fractios. Theorem (Lagrage). Let x R \ Q ad let p q be its -th coverget (where p ad q are coprime) ad let p p q with p q Z be distict from q ad such that 0 < q q. The x p < x p q. q It is also kow how well the cotiued fractios approximate irratioal umbers. Theorem. Let x R \ Q ad let p q be its -th coverget (where p ad q are coprime). The either x p < or x p <. q q q q Ad i a certai way oly cotiued fractios get very close to irratioal umbers. Theorem (Legedre). Let x R\Q ad let p q with p q Z satisfy x p q < The p q is a coverget of x. Cotiued fractios ad cotiuats The covergets of cotiued fractios are closely related to the so-called cotiuats K (x... x ). q.
Theorem. Let x 0 R x i > 0 i N. The it holds x 0 x... x = K (x 0 x... x ) K (x... x ) where the polyomial K (x... x ) is give by the recurrece relatio K = 0 K 0 = ad for K (x... x ) = K (x... x )x K (x... x ). Theorem 5. For every N ad x... x R we have K (x... x ) = K (x... x ). Corollary. Let [a 0... a... ] be the cotiued fractio of a irratioal umber x. The its -th coverget p q satisfies p = K (a 0... a ) q = K (x... x ). Cotiued fractios of quadratic umbers We will call a quadratic irratioal a irratioal root α of a quadratic equatio Ax Bx C = 0 where A B C Z. The secod root of the equatio will be deoted α ad called the (algebraic) cojugate of α. I order to state the theorem describig cotiued fractios of quadratic irratioals we eed to recall that a cotiued fractio [a 0... a... ] is called evetually periodic if [a 0... a... ] = [a 0... a k a k... a l ] starts with a preperiod a 0... a k ad the a period a k... a l is repeated a ifiite umber of times. Theorem 6 (Lagrage). Let α R \ Q. The cotiued fractio of α is evetually periodic if ad oly if α is a quadratic irratioal. Theorem 7 (Galois). Let α be a quadratic irratioal ad α its cojugate. The cotiued fractio of α is purely periodic if ad oly if α > ad α ( 0). Example. Let α = 5 i.e. the so-called Golde ratio the it is the root of x x = 0 ad α = 5 ( 0). The cotiued fractio of α is ideed purely periodic sice cosequetly α = [ ]. α = 5 = 5 = α I the sequel whe we restrict our cosideratio to square roots of atural umbers we will make use of the followig lemma. Lemma. Let α be a quadratic irratioal ad α its cojugate. If α has a purely periodic cotiued fractio [a 0 a... a ] the α = [a... a a 0 ].
5 Cotiued fractios of N Let us cosider N N \ {0} such that N is ot a square. If N = k for some k N the N = k ad the cotiued fractio is N = [k]. For every N N \ {0} which is ot a square there exists a uique N \ {0} ad a uique j {... } such that N = j. Theorem 8. For every N\{0} ad every j {... } the cotiued fractio of j is of the form [ a... a r ] where a... a r is a palidrome. Proof. This proof ca be foud i [] page 5. However we repeat it here sice it follows almost immediately from the previous statemets ad it gives a isight ito the form of cotiued fractios of quadratic umbers. Deote α j. The α is a quadratic irratioal greater tha ad α = j ( 0). Therefore α has by Theorem 7 a purely periodic cotiued fractio i.e. there exist a... a r N such that α = [ a... a r ]. It is thus evidet that j = [ a... a r ]. It remais to prove that a... a r is a palidrome. Accordig to Lemma the umber α has its cotiued fractio equal to [a r... a ]. We obtai thus j = [ a r... a ]. j α Sice the cotiued fractio of irratioal umbers is uique ad we have j = [ a... a r ] = [ a r... a ] it follows that a = a r a = a r etc. Cosequetly a... a r is a palidrome. Theorem 9. The cotiued fractio of the form [ a... a r ] where a... a r is a palidrome correspods to N for a ratioal umber N. Proof. Deote by x the umber whose cotiued fractio equals [ a... a r ] i.e. x. a... Hece by Theorem a r (x ) x = Kr(a...arx) K r(a...a rx) = Kr (a...ar )(x)kr (a...ar) K. r (a...a r )(x)k r(a...a r) By Theorem 5 ad sice a... a r is a palidrome we have K r (a... a r ) = K r (a... a r ). Cosequetly we obtai x = K r (a... a r ) K r (a... a r ) K r (a... a r ) where uder the square root there is certaily a ratioal umber sice by their defiitio cotiuats with iteger variables are itegers.
I the sequel let us study the legth of the period ad the form of the cotiued fractio of N = j i depedece o ad j where N \ {0} ad j {... }. We will prove oly some of observatios sice the proofs are quite techical ad space-demadig. The rest of proofs may be foud i [5]. I Table 5 we have highlighted all classes of ad j for which their cotiued fractios of N = j have bee described. Observatio. The cotiued fractio of N has period of legth if ad oly if N =. It holds the N = [ ]. Proof. This observatio has bee doe already i [7]. ( ) : = hece N = [ ]. ( ) : If the legth of the period equals the by Theorem 8 we have N = [ ]. j ( j ) j hece we have j = j j j = j j =. Observatio. The cotiued fractio of N has period of legth if ad oly if j is a iteger. It holds the N = [ j ]. Proof. ( ) : j ( j ) j j j j j j j j ( j ) thus N = [ j ]. ( ) : If the legth of the period equals the by Theorem 8 we have N = 5
[ x ]. hece we have j ( j ) x ( j ) j = x( j ) j x = j. Observatio. If the cotiued fractio of N has period of legth the j is a odd umber ad N = [ x x ] where x is a eve umber. Proof. If the legth of the period equals the by Theorem 8 we have N = [ x x ]. j x x ( j ) hece we get j = x x. The coditio that j ad x must be itegers implies the statemet. Observatio. Let j =. If is eve the the legth of the period is ad N = [ j ]. If is odd the the legth of the period is 5 ad N = [ ]. Proof. If is eve j is a iteger ad the statemet is a corollary of Observatio. If is odd it holds = 6
( ) ( ) ( ( )) thus N = [ ]. ( ) ( ) ( ) Observatio 5. For > ad j = the legth of the period is ad the cotiued fractio is the N = [ ]. 7
Proof. = hece N = [ ] ( ) ( ) ( ) ( ) ( ) ( ) Observatio 6. For > ad j = either the legth of the period is if is odd ad the cotiued fractio is the N = [ ] or the legth of the period is 6 if is eve ad the cotiued fractio is the N = [ ]. Proof. For odd: = 8
( ) ( ) ( ) 6 ( ) ( ) thus N = [ ]. For eve: = ( ) 9
( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) 0
. ( ) Thus N = [ ]. Observatio 7. Let k N. Let us summarize legths l of periods ad the form of cotiued fractios for several classes (described i a aalogous way) of ad j. j l N 5k k 5 [ ] 6k 5 [ ] 9k k [ 8 9 ] 8 5k 5 [ ] 5 k [ ] k k [ ] k [ ] k k [ ] 5k k [ 5 ] 5 6k k 6 [ ] 6 5k 5 5 [ ] 0k 7 5 6 [ ] k k 6 [ ] k k 6 [ ] 7k k 6 [ 6 7 ] 7 6k 6 6 [ ] k k 6 [ ] 8 7k 5 7 8 [ ] 6k k 8 [ ] Observatio 8. If the period of the cotiued fractio of N = j cotais p oes as its palidromic part i.e. N = [... ] the p k }{{} p where k N ad j = Fp Fp F p where F deotes the -th Fiboacci umber give by the recurrece relatio F = 0 F 0 = ad F = F F for all. We made also oe observatio that tured out to be false.
Observatio 9. For N the legth of the period of the cotiued fractio is less tha or equal to. This observatio was made whe cotemplatig a table of periods of N for N 000. However i [8] it is show that for N = 76 with = the period of the cotiued fractio of N is of legth 88 > 8 =. A rougher upper boud comes from [7]. Theorem 0. For N the legth of the period of the cotiued fractio is less tha or equal to N. Let us termiate with two observatios that have ot bee proved yet. Observatio 0. No elemet of the period of N apart from the last oe is bigger tha. Observatio. There is o period of a odd legth for j = k where k N. We ackowledge fiacial support by the Czech Sciece Foudatio grat 0/09/058 by the grats MSM68077009 ad LC0600 of the Miistry of Educatio Youth ad Sports of the Czech Republic ad by the Grat Agecy of the Czech Techical Uiversity i Prague grat No. SGS/6/OHK/T/. Refereces [] Klazar M.: Itroductio to Number Theory KAM-DIMATIA Series 78 006. [] Masáková Z. Pelatová E.: Teorie čísel skriptum ČVUT 00. [] Muller J.-M.: Elemetary Fuctios: Algorithms ad Implemetatio d editio Birkhäuser Bosto 006. [] Lauritze N.: Cotiued fractios ad factorig http://home.imf.au.dk/iels/cfracfact.pdf 009. [5] Hrušková A.: Řetězové zlomky kvadratických čísel SOČ práce http://kmliux.fjfi.cvut.cz/ balkolub/socteocisel 0 0 [6] Seidesticker R.: Cotiued fractios for high-speed ad high-accuracy computer arithmetic IEEE Symposium o Computer Arithmetic (98) 8 9 [7] Sierpiski W.: Elemetary Theory of Numbers Pastwowe Wydawictwo Naukowe Warszawa 96. [8] Hickerso D. R.: Legth of period of simple cotiued fractio expasio of d Pacific Joural of Mathematics 6() (97) 9
Figure : All classes of 9 (first colum) ad j (first row) for which their cotiued fractios of N = j have bee described are highlighted.