Continued Fraction Calculator
Convert fractions to continued fraction notation
Understanding Continued Fractions
A continued fraction is an expression obtained through an iterative process of representing a number as the sum of its integer part and the reciprocal of another number. This powerful mathematical tool has applications in number theory, approximation theory, and algorithm design.
Standard Form
A continued fraction is typically written as:
a₀ + 1/(a₁ + 1/(a₂ + 1/(a₃ + ...)))
Or in compact notation: [a₀; a₁, a₂, a₃, ...]
The Euclidean Algorithm
To find a continued fraction representation, we use the Euclidean algorithm:
- Divide the numerator by the denominator to get quotient and remainder
- The quotient becomes the next coefficient
- Replace the numerator with the old denominator
- Replace the denominator with the remainder
- Repeat until the remainder is zero
Convergents
Convergents are the rational approximations you get by truncating the continued fraction at each step. They provide increasingly accurate approximations to the original number and have remarkable properties:
- Each convergent is the best rational approximation with that denominator size
- Odd-indexed convergents approach from below, even from above
- The sequence of convergents provides increasingly accurate approximations
- No fraction with smaller denominator is closer to the target value
Famous Examples
Golden Ratio (φ ≈ 1.618...):
[1; 1, 1, 1, 1, ...] (infinite pattern of 1s)
√2 ≈ 1.414...:
[1; 2, 2, 2, 2, ...] (infinite pattern of 2s)
π ≈ 3.14159...:
[3; 7, 15, 1, 292, 1, ...]
Approximation 355/113 = [3; 7, 15, 1]
e ≈ 2.71828...:
[2; 1, 2, 1, 1, 4, 1, 1, 6, ...]
Applications
- Number theory: Finding best rational approximations
- Music theory: Calculating musical intervals and temperament
- Calendar systems: Approximating year lengths
- Gear ratios: Designing mechanical systems
- Computer graphics: Line drawing algorithms (Bresenham's)
- Cryptography: RSA algorithm and key generation
- Physics: Quantum mechanics and resonance phenomena
Properties
- Finite continued fractions represent rational numbers
- Infinite continued fractions represent irrational numbers
- Periodic continued fractions represent quadratic irrationals
- Convergents alternate above and below the true value
- Each convergent is closer than any fraction with smaller denominator
Frequently Asked Questions
What is a continued fraction?
A continued fraction is a representation of a number as a sequence of integer parts and reciprocals. Instead of writing 355/113, you write it as 3 + 1/(7 + 1/(15 + 1/1)). This form, written compactly as [3; 7, 15, 1], reveals mathematical properties and provides excellent rational approximations.
What are convergents?
Convergents are the rational numbers you get by truncating the continued fraction at each step. For [3; 7, 15, 1], the convergents are 3/1, 22/7, 333/106, and 355/113. Each convergent is a better approximation than the previous one and is the best possible approximation with a denominator that small.
Why are continued fractions useful?
Continued fractions provide the best rational approximations to numbers. They're used in many fields: finding gear ratios in engineering, approximating irrational numbers in mathematics, generating encryption keys in cryptography, and even tuning musical instruments. They also reveal patterns in irrational numbers like π and e.
Do all numbers have continued fraction representations?
Yes, every real number has a continued fraction representation. Rational numbers (fractions) have finite continued fractions that terminate. Irrational numbers have infinite continued fractions. Special irrationals like √2 and the golden ratio have repeating patterns, while π and e have non-repeating infinite expansions.
How is 355/113 related to π?
355/113 ≈ 3.14159292 is one of the best simple rational approximations to π (which is about 3.14159265). It's accurate to 6 decimal places! This fraction comes from the continued fraction representation of π: [3; 7, 15, 1, 292, ...]. It's much more accurate than the commonly known 22/7 approximation.
What's the relationship with the Euclidean algorithm?
The Euclidean algorithm for finding the greatest common divisor (GCD) and the continued fraction algorithm are essentially the same process. When you compute GCD(355, 113), the quotients at each step (3, 7, 15, 1) are exactly the coefficients of the continued fraction [3; 7, 15, 1]. This connection reveals deep mathematical structure.