"Do not worry about your problems with mathematics, I assure you mine are far greater." Albert Einstein
A continued fraction is an expression of the form
- and are either integers, rational numbers, real numbers, or complex numbers.
- , etc., are called the coefficients or terms of the continued fraction
Variants or types :
- If for all the expression is called a simple continued fraction.
- If the expression contains a finite number of terms, it is called a finite continued fraction.
- If the expression contains an infinite number of terms, it is called an infinite continued fraction.
Thus, all of the following illustrate valid finite simple continued fractions:
|All integers are a degenerate case|
|Simplest possible fractional form|
|First integer may be negative|
|First integer may be zero|
simple continued fractionsEdit
Every finite continued fraction represents a rational number :
Every infinite continued fraction is irrational number :
The rational number obtained by limited number of terms in a continued fraction is called a n-th convergent
because sequence of rational numbers converges to irrational number
In other words irrational number is the limit of convergent sequence.
Nominator p and denominator q can be found using the relevant recursive relation:
Key words :
- the sequence of continued fraction convergents of irrational number
- sequence of the convergents
- continued fraction expansion
- rational aproximation of irrational number
- a best rational approximation to a real number r by rational number p/q
How to use it in computer programsEdit
In Maxima CAS one have cf and float(cfdisrep())
(%i2) a:[0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1] (%o2) [0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1] (%i3) t:cfdisrep(a) (%o3) 1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/1)))))))))))))))))))))) (%i4) float(t) (%o4) 0.618033988957902
To compute n-th convergent:
(%i10) a; (%o10) [0, 3, 2, 1000, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1] (%i11) a3: listn(a,3); (%o11) listn([0, 3, 2, 1000, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], 3) (%i12) a3: firstn(a,3); (%o12) [0, 3, 2] (%i13) cf3:cfdisrep(a3); 1 (%o13) ----- 1 3 + - 2 (%i14) r3:ratsimp(cf3); 2 (%o14) - 7 (%i15)
- Continued Fractions and Dynamics by Stefano Isola
- Darren C. Collins, Continued Fractions, MIT Undergraduate Journal of Mathematics,
- continued fractions based functions over the complex plane
- continued-fractions-with-applications by L. Lorentzen H. Waadeland
- Continued Fractions, Discrete Groups and Complex Dynamics by Alan F. Beardone. Beardone, A.F. Comput. Methods Funct. Theory (2001) 1: 535. https://doi.org/10.1007/BF03321006