H6X9H


Continued fraction

The relationship between a pair (N,D) and a reduced pair (N’, D’) can be rearranged according to the structure of a continued fraction (CF) . Four situations can be distinguished. We start again with the characteristic equation: N = K * D + E .

Case 1 : E < D/2

          Reduction : N’ = E and D’ = D mod( 2*N’) = D - 2 * s * N’

          Case 1A: D’ < N’

                        

          Case 1B: D’ > N’

                            with D” = 2*N’ - D’

Case 2 : E > D/2

          Reduction : N’ = D - E and D’ = D mod( 2*N’) = D - 2 * s * N’

          Case 2A: D’ < N’

                        

          Case 2B: D’ > N’

                            with D” = 2*N’ - D’