To calculate a continued fraction representation of a number r, write down the integer part (technically the floor) of r. Subtract this integer part from r. If the difference is 0, stop; otherwise find the reciprocal of the difference and repeat. The procedure will halt if and only if r is rational.

How do continued fractions work?

Continued fractions are written as fractions within fractions which are added up in a special way, and which may go on for ever. Every number can be written as a continued fraction and the finite continued fractions are sometimes used to give approximations to numbers like \sqrt 2 and \pi .

What is the use of continued fractions?

The continued fraction expansion of a real number x is a very efficient process for finding the best rational approximations of x. Moreover, continued fractions are a very versatile tool for solving problems related with movements involving two different periods.

Who created continued fractions?

The Dutch mathematician and astronomer Christiaan Huygens (1629-1695) was the first to demonstrate a practical application of continued fractions. [6][5] He wrote a paper explaining how to use the convergents of a continued fraction to find the best rational approximations for gear ratios.

How do you find the continued fraction of a square root?

You keep doing this until you find a guess g where g 2 ≤ n and ( g + 1) 2 > n, and then a 0 = g. a 0 is simply the largest integer such that a 2 ≤ n . You can determine the continued fraction for a square root by performing the 1 n − a 0 step and then using the conjugate to remove the square root from the denominator, and repeating.

Is the continued fraction expansion of a number base independent?

In a sense, the continued fraction expansion of a real number is base independent. Since these expansions are given by listing nonnegative integers, when we consider expansions in different bases the only thing that changes is how we represent those integers.

What is the formula to find a finite simple continued fraction?

This is often written more compactly in the following ways: a 0 + 1 a 1 + 1 a 2 + 1 a 3 + ⋯ = [ a 0; a 1, a 2, a 3, …]. ,…]. As noted above, a finite simple continued fraction is a rational number.

How do you reverse a continued fraction?

As with rational numbers, this process can be reversed. as a simple continued fraction. The idea is to iterate the process of taking the greatest integer and reciprocating, as follows: and the process repeats. These examples motivate the following theorem about periodic continued fractions. r = [ a 0; a 1, a 2, …]