Library/Arithmetic/Fractions/Continued fractions

Continued fractions

Overview
Important

A simple continued fraction is an expression of the form a0+1a1+1a2+1a3+a_0 + \frac{1}{a_1 + \frac{1}{a_2 + \frac{1}{a_3 + \cdots}}} where a0a_0 is an integer and all aia_i for i1i \geq 1 are positive integers. Every rational number can be written as a finite continued fraction, and some irrational numbers have infinite continued fraction representations.

Important properties

  • Continued fractions give the best possible rational approximations to real numbers.

  • The process of converting a fraction to a continued fraction is related to the Euclidean algorithm.

  • The convergents (the values you get by stopping after a certain number of terms) get closer and closer to the actual value.