Continued Fractions

Download as PDF

Ever seen a fraction inside a fraction, nested over and over? That's a continued fraction, a powerful way to represent numbers that reveals hidden patterns and provides the best possible rational approximations for numbers like π and 2.

Continued Fractions — an original Algebra911 reference diagram defining continued fractions with its key formula and a worked example.
Understanding Continued Fractions: A Complete Guide

What Are Continued Fractions?

A continued fraction is a way of representing a number as a sum of an integer and the reciprocal of another number, which is itself a sum of an integer and another reciprocal, and so on. Instead of expressing a number with a single numerator and denominator, we break it down into a chain of fractions nested inside each other. This unique structure can reveal deep properties of numbers.

Think about the fraction 73. We know this is 2 with a remainder. Specifically, it's 2+13. This is a very simple continued fraction. The integer part is 2, and the fractional part is 13.

Now consider a more complex example:

1+12+13+14

This is a finite continued fraction because the chain of fractions eventually stops. The integers 1,2,3, and 4 are called the coefficients or terms of the continued fraction. All continued fractions we create from regular, rational fractions (like ab) will be finite.

However, some numbers, like π or 2, are irrational. Their decimal representations go on forever without repeating. Amazingly, their continued fractions also go on forever! These are called infinite continued fractions. This distinction between finite and infinite forms is one of the most powerful aspects of continued fractions.

How Do You Convert a Rational Number into a Continued Fraction?

Converting a standard fraction into a continued fraction is a step-by-step process that uses division and reciprocals. The method is sometimes called the Euclidean Algorithm in disguise. Let's break it down into a repeatable algorithm.

The Algorithm:

  1. Start with your fraction, for example, 4319.
  2. Find the integer part of the fraction. This is the first term of your continued fraction. To do this, perform the division: 43÷19=2 with a remainder. So, the integer part is 2.
  3. Write the original fraction as the integer part plus a new, smaller fraction: 4319=2+519.
  4. Now, take the reciprocal of that new fractional part. The reciprocal of 519 is 195.
  5. Repeat the process with this new fraction. Go back to step 2 with 195.
  6. Continue this cycle until the fractional part becomes zero (or you have enough terms for an approximation).
Example 1

Let's convert the fraction 4319 into a continued fraction.

Step 1: Start with 4319.
Divide 43 by 19. It goes in 2 times with a remainder of 5 (since 2×19=38 and 4338=5).
So, 4319=2+519. Our first integer is 2.

Step 2: Focus on the fractional part, 519. We need to write it as 1something. To do that, we take the reciprocal: 1195.
So now our expression is 2+1195.

Step 3: Repeat the process for the new fraction, 195.
Divide 19 by 5. It goes in 3 times with a remainder of 4 (since 3×5=15 and 1915=4).
So, 195=3+45. Our second integer is 3.

Step 4: Substitute this back into our main expression:
2+13+45

Step 5: Take the reciprocal of the newest fraction, 45, to get 54.
Divide 5 by 4. It goes in 1 time with a remainder of 1.
So, 54=1+14. Our third and fourth integers are 1 and 4.

Final Result: Putting it all together, we get our final continued fraction:
4319=2+13+11+14

What's the Shorthand Notation for Continued Fractions?

Writing out the full nested fraction structure can be cumbersome, especially for longer fractions. To simplify this, mathematicians use a compact shorthand notation. This notation simply lists the integer parts you discovered during the conversion process.

The general form of the notation is:

[a0;a1,a2,a3,]

Here's what each part means:

  • a0 is the initial integer part of the number. It's special and is separated from the rest by a semicolon. It can be any integer (positive, negative, or zero).
  • a1,a2,a3, are the subsequent integer parts found in the denominators. For a standard continued fraction, these must be positive integers.

Let's look at our previous example, 4319. We found the integer parts to be 2,3,1, and 4. In shorthand notation, this is written as:

[2;3,1,4]

This is much cleaner and easier to write than the full nested fraction. Reading this notation, you immediately know that 2 is the main integer part, 3 is the integer in the first denominator, 1 is in the second, and so on.

For an infinite continued fraction, the list of terms simply goes on forever. For example, the famous Golden Ratio, ϕ, has a beautiful and simple infinite continued fraction:

ϕ=[1;1,1,1,1,]

This tells us ϕ=1+11+11+.

How Do You Convert a Continued Fraction Back to a Regular Fraction?

Converting a continued fraction in its shorthand notation back to a simple rational number is a straightforward process of simplification. You start at the very end (the bottom-right of the nested fraction) and work your way back up.

The Algorithm:

  1. Write out the full nested fraction from the shorthand notation.
  2. Identify the innermost (bottom-most) part of the fraction.
  3. Calculate the value of that part. It will be an integer plus a fraction.
  4. Take the reciprocal of that result and add it to the integer at the next level up.
  5. Repeat this process of simplifying, taking the reciprocal, and adding, until you reach the top and have a single fraction.
Example 2

Let's convert the continued fraction [2;1,3,2] back into a simple fraction.

Step 1: Write out the full nested fraction form.
2+11+13+12

Step 2: Start at the very bottom. The innermost expression is 3+12.
Let's calculate its value: 3+12=62+12=72.

Step 3: Substitute this back into the larger fraction.
2+11+172

Step 4: Now simplify the next level up. We have 172, which is the reciprocal of 72. So, 172=27.
The expression becomes 1+27.
Let's calculate its value: 1+27=77+27=97.

Step 5: Substitute this new value back into the main expression.
2+197

Step 6: Once again, we have 197, which is the reciprocal of 97. So, 197=79.
Our final calculation is 2+79.
2+79=189+79=259.

Final Answer: The continued fraction [2;1,3,2] is equal to the simple fraction 259.

What Do Continued Fractions Reveal About Irrational Numbers?

One of the most exciting applications of continued fractions is in the study of irrational numbers. As we've seen, rational numbers always produce finite continued fractions. The reverse is also true: any finite continued fraction will always simplify to a rational number.

This leads to a profound conclusion: irrational numbers are precisely the numbers whose continued fractions are infinite.

This gives us a new way to classify numbers:

  • Rational Numbers: Finite continued fractions. Example: 259=[2;1,3,2].
  • Irrational Numbers: Infinite continued fractions. Example: π=[3;7,15,1,292,].

But it gets even more interesting. Some irrational numbers have continued fractions that, while infinite, exhibit a repeating pattern. These are called periodic continued fractions. It turns out that an irrational number has a periodic continued fraction if and only if it is a quadratic irrational—a number that can be written as a solution to a quadratic equation with integer coefficients, like ax2+bx+c=0. This includes all numbers of the form p+qd, where p and q are rational and d is a non-perfect-square integer.

Example 3

Let's explore the continued fraction for 2, a classic quadratic irrational.

Step 1: Find the integer part of 2. We know 12=1 and 22=4, so 2 is between 1 and 2. The integer part is 1.
So, 2=1+(21).

Step 2: Take the reciprocal of the fractional part, (21).
121 To simplify this, we rationalize the denominator by multiplying the top and bottom by the conjugate, (2+1):
121×2+12+1=2+121=2+1

Step 3: Find the integer part of this new number, 2+1. Since 21.414, then 2+12.414. The integer part is 2.
So, 2+1=2+(21).

Step 4: Notice something amazing. The new fractional part is (21), which is exactly what we had in Step 1! If we take its reciprocal, we will get 2+1 again, whose integer part is 2. This process will repeat forever.

Conclusion: The sequence of integer parts is 1,2,2,2,.
The continued fraction for 2 is [1;2,2,2,], often written with a bar over the repeating part: [1;2].

How Do Continued Fractions Give Us the Best Approximations?

Because irrational numbers go on forever, we can't write them down exactly. We rely on approximations like π3.14 or π227. Continued fractions provide a systematic way to find the very best rational approximations for any number.

These approximations are called convergents. A convergent of a continued fraction is the rational number you get by stopping the fraction at a certain term. Each successive convergent gets closer to the true value of the number.

Let's take the continued fraction for π: [3;7,15,1,292,].

  • The 0th convergent is just the first term: [3]=3.
  • The 1st convergent is [3;7]=3+17=227. This is the famous approximation for Pi!
  • The 2nd convergent is [3;7,15]=3+17+115=3+110615=3+15106=318+15106=333106.
  • The 3rd convergent is [3;7,15,1]=355113. This is an incredibly accurate approximation.

The magic of convergents is that they are the 'best' rational approximations in a specific sense: no other fraction with a smaller denominator can be closer to the true value. For example, 227 is the best approximation of π among all fractions with a denominator of 7 or less.

Convergents of π

ConvergentNotationFractionDecimal ValueDifference from π
0th3313.000000...~ -0.14159
1st3;72273.142857...~ +0.00126
2nd3;7,153331063.141509...~ -0.000083
3rd3;7,15,13551133.1415929...~ +0.00000026
4th3;7,15,1,292103993331023.141592653...~ -0.0000000005

What Are Some Common Mistakes with Continued Fractions?

While the process is algorithmic, there are a few common pitfalls to watch out for when working with continued fractions.

  • Forgetting the Reciprocal: When converting a fraction like 2+519, a common error is to continue the process with 519. You must write it as 2+1195 and continue the process with the reciprocal, 195.
  • Notation Errors: The semicolon in [a0;a1,a2,] is important. It separates the initial integer part (which can be zero or negative) from the subsequent parts (which must be positive integers). Using all commas can cause confusion.
  • Calculation Order: When converting from shorthand back to a simple fraction, you must work from the bottom up (or right to left). Starting from the left (e.g., calculating 2+11 first in [2;1,3,2]) will give the wrong answer. Always start at the very end.
  • Assuming All Irrationals Repeat: It's tempting to think that all irrational numbers have neat, repeating continued fractions like 2. This is not true. Only quadratic irrationals have repeating patterns. Numbers like π and e have infinite, non-repeating continued fractions (though e has a different, interesting pattern).

Continued Fractions: A Quick Summary

Here are the key takeaways from our exploration of continued fractions.

  • Definition: A continued fraction represents a number as a sequence of nested fractions, with an integer part and a series of reciprocals.
  • Conversion To: To convert a rational number pq to a continued fraction, repeatedly find the integer part and take the reciprocal of the remaining fractional part.
  • Conversion From: To convert a continued fraction [a0;a1,a2,] back to a rational number, start from the last term and work your way up, simplifying at each step.
  • Notation: The shorthand [a0;a1,a2,,an] is a compact way to list the integer coefficients.
  • Rational vs. Irrational: Rational numbers always have finite continued fractions. Irrational numbers always have infinite continued fractions.
  • Periodic Fractions: Quadratic irrationals (like 3 or 1+5) have infinite continued fractions that eventually repeat a pattern.
  • Convergents: Stopping an infinite continued fraction at any point gives a rational number called a convergent. These convergents are the best possible rational approximations of the original number for a given denominator size.

Frequently Asked Questions

Why are they called 'continued' fractions?

They are called 'continued' because the process of finding the next term can be continued, theoretically forever. For any number, you find its integer part and the fractional remainder, and you 'continue' the process on the reciprocal of that remainder.

Can a term in a continued fraction be zero or negative?

The first term, a0, can be any integer: positive, negative, or zero. However, for a simple continued fraction, all subsequent terms (a1,a2,) must be positive integers. A zero would imply division by zero in the next step, which is undefined.

What are continued fractions actually used for?

They have many uses in number theory for analyzing the properties of rational and irrational numbers. They are also used in computer science for algorithms, in physics for analyzing gear ratios, and in cryptography. Their ability to produce the best rational approximations is highly valuable.

Does every number have a unique continued fraction?

Yes, with one minor exception. Every irrational number has a unique simple continued fraction. Every rational number has a unique one, provided the last term is not 1. For example, [2;3,1] is the same as [2;4], so a rule is made to always use the shorter form.

How is this related to the Euclidean Algorithm?

The process of finding the terms of a continued fraction for a rational number ab is identical to the steps of the Euclidean Algorithm for finding the greatest common divisor of a and b. The quotients you find at each step of the algorithm are the terms of the continued fraction.

Is there an easy way to calculate these?

Yes, many scientific and programming calculators have functions to find continued fractions. For manual calculation, the step-by-step division-and-reciprocal method is the most reliable way to find the terms for a rational number.

What does the semicolon in the notation [a₀; a₁, ...] mean?

The semicolon is a notational convention to separate the whole number part of the value (a₀) from the fractional part that follows. It highlights that a₀ can be any integer (positive, negative, or zero), while the subsequent terms (a₁, a₂, etc.) in a simple continued fraction must be positive integers.