Skip to main content
Calkulon
Back to Guides
6 min read5 Steps

How to Calculate Continued Fractions by Hand: Step-by-Step Guide

Learn to manually expand real numbers or fractions into continued fractions, understand the process, and calculate convergents. Perfect for students!

Skip the math — use the calculator

Step-by-Step Instructions

1

Understand the Goal: The 'Integer Part, Reciprocal of Fractional Part' Cycle

Your main objective is to repeatedly break down a number into its largest integer part and a fractional remainder. Once you have the fractional remainder, you'll take its reciprocal and treat that new number as your starting point for the next step. This cycle continues until your fractional remainder is zero (for rational numbers).

2

Extract the First Integer (a₀) and Its Remainder

Start with your given number, let's call it 'x'. 1. **Find the first partial quotient (a₀):** Calculate `a0 = floor(x)`. This is simply the largest whole number less than or equal to `x`. 2. **Calculate the fractional remainder:** Subtract `a0` from `x`. This gives you `x - a0`. If this remainder is `0`, you're done, and your continued fraction is just `[a0]`.

3

Invert the Remainder and Repeat the Process

If your fractional remainder from Step 2 was not zero: 1. **Take the reciprocal:** Calculate `1 / (x - a0)`. This new number becomes your 'x' for the next iteration. 2. **Repeat Steps 2 and 3:** With this new 'x', find its integer part (which will be `a1`), calculate its fractional remainder, and if it's not zero, take its reciprocal again. Continue this cycle to find `a2, a3, a4`, and so on.

4

Assemble the Continued Fraction Notation

Once the process terminates (or you've decided to stop for an irrational number), gather all the integer parts you've found: `a0, a1, a2, a3, ...`. Write them in the standard continued fraction notation: `[a0; a1, a2, a3, ...]`. The semicolon separates the first integer (`a0`) from all subsequent integers, which are separated by commas.

5

Calculate Convergents (Optional, but Recommended for Understanding)

To build a deeper understanding and verify your work, calculate the 'convergents'. These are the rational approximations you get by truncating your continued fraction. * **C0 = a0** * **C1 = a0 + 1/a1** * **C2 = a0 + 1/(a1 + 1/a2)** * And so on. For rational numbers, your last convergent should be your original number. For irrational numbers, convergents provide increasingly accurate approximations.

Hello there, aspiring mathematician! Have you ever wondered if there's another way to represent numbers, beyond decimals and simple fractions? Enter continued fractions – a fascinating and powerful way to express any real number as a sequence of integers. They're not just a mathematical curiosity; they're incredibly useful for finding excellent rational approximations of irrational numbers (like Pi or the square root of 2) and have applications in number theory, cryptography, and even music!

This guide will walk you through the process of calculating continued fractions manually, step-by-step. You'll learn the underlying logic, see a practical example, and understand common pitfalls to avoid. While online calculators are super convenient, knowing how to do it by hand gives you a deeper understanding and appreciation for these elegant mathematical structures.

What Exactly is a Continued Fraction?

Imagine a fraction that keeps going, with fractions within fractions! A simple continued fraction looks like this:

a0 + 1/(a1 + 1/(a2 + 1/(a3 + ...)))

Where a0, a1, a2, a3, and so on, are integers. a0 can be any integer, but a1, a2, a3, ... must be positive integers. We often write this in a more compact notation: [a0; a1, a2, a3, ...]. The terms a0, a1, a2, ... are called partial quotients.

Prerequisites

Before we dive in, make sure you're comfortable with:

  • Basic Arithmetic: Addition, subtraction, multiplication, and division.
  • Fractions: Understanding how to work with proper and improper fractions.
  • Integers: Knowing the difference between an integer (whole number) and a fractional part.
  • Floor Function: The floor(x) function simply means taking the largest integer less than or equal to x. For example, floor(3.7) = 3 and floor(5) = 5.

Ready? Let's get started!

Worked Example: Converting 25/7 to a Continued Fraction

We'll use the fraction 25/7 as our example. Our goal is to express it in the form [a0; a1, a2, a3, ...]. The core idea is to repeatedly extract the integer part of a number, then take the reciprocal of its fractional remainder, and repeat the process.

The Formula (Algorithm)

Given a number x:

  1. Let a_i = floor(x). This is your current partial quotient.
  2. If x - a_i = 0, you're done! The process terminates.
  3. Otherwise, calculate the new x for the next step: x_new = 1 / (x - a_i). This is the reciprocal of the fractional part.
  4. Repeat from step 1 with x_new.

Let's apply this to 25/7.

Step-by-Step Calculation

Iteration 1:

  • Start with x = 25/7
  • a0 = floor(25/7) = floor(3 and 4/7) = 3
  • Fractional part: 25/7 - 3 = 25/7 - 21/7 = 4/7
  • Since the fractional part is not zero, we continue. New x = 1 / (4/7) = 7/4

Iteration 2:

  • Now x = 7/4
  • a1 = floor(7/4) = floor(1 and 3/4) = 1
  • Fractional part: 7/4 - 1 = 7/4 - 4/4 = 3/4
  • New x = 1 / (3/4) = 4/3

Iteration 3:

  • Now x = 4/3
  • a2 = floor(4/3) = floor(1 and 1/3) = 1
  • Fractional part: 4/3 - 1 = 4/3 - 3/3 = 1/3
  • New x = 1 / (1/3) = 3

Iteration 4:

  • Now x = 3
  • a3 = floor(3) = 3
  • Fractional part: 3 - 3 = 0
  • The fractional part is zero, so we stop here! Our sequence of partial quotients is a0=3, a1=1, a2=1, a3=3.

Therefore, the continued fraction for 25/7 is [3; 1, 1, 3].

Calculating Convergents (Approximations)

Convergents are the rational approximations you get by truncating the continued fraction at different points. They provide increasingly accurate approximations of the original number. For [a0; a1, a2, a3] = [3; 1, 1, 3]:

  • C0 (0th convergent): a0 = 3
  • C1 (1st convergent): a0 + 1/a1 = 3 + 1/1 = 4
  • C2 (2nd convergent): a0 + 1/(a1 + 1/a2) = 3 + 1/(1 + 1/1) = 3 + 1/2 = 7/2
  • C3 (3rd convergent): a0 + 1/(a1 + 1/(a2 + 1/a3)) = 3 + 1/(1 + 1/(1 + 1/3)) = 3 + 1/(1 + 1/(4/3)) = 3 + 1/(1 + 3/4) = 3 + 1/(7/4) = 3 + 4/7 = 25/7

Notice how the last convergent C3 perfectly matches our original number 25/7! This is always the case for rational numbers.

Common Pitfalls to Avoid

  • Using Decimals: While 25/7 is approximately 3.5714..., using decimals directly in your calculations can lead to rounding errors and prevent you from finding the exact continued fraction for rational numbers. Always stick to fractions if your starting number is rational.
  • Incorrect Subtraction: Double-check your calculation of x - a_i. A small mistake here will throw off all subsequent steps.
  • Forgetting to Invert: Remember, after subtracting the integer part, you must take the reciprocal (1 / fractional_part) to get the new number for the next iteration.
  • Irrational Numbers Don't Terminate: If you're working with an irrational number (like sqrt(2) or pi), the process will never end. You'll need to decide how many terms (a_i) you want to calculate for your desired level of approximation.

When to Use a Continued Fraction Calculator

Calculating continued fractions by hand is a fantastic way to understand the process. However, for practical purposes, a calculator is your best friend when:

  • Speed is Key: If you need to find many terms quickly.
  • Complex Numbers: For very large numerators and denominators, or numbers with many decimal places, manual calculation becomes tedious and error-prone.
  • Checking Your Work: After doing it by hand, a calculator can quickly verify your results.
  • Irrational Numbers: To generate a long sequence of partial quotients for irrational numbers, a calculator is indispensable.

Keep Exploring!

Mastering continued fractions by hand gives you a unique insight into number theory. It's a testament to the beauty and interconnectedness of mathematics. Keep practicing with different numbers, and you'll soon find yourself comfortably navigating these elegant expressions. Happy calculating!

Ready to Calculate?

Skip the manual work and get instant results.

Open Calculator

Settings

PrivacyTermsAbout© 2026 Calkulon