Skip over navigation
Cambridge University Faculty of Mathematics NRich logo
menu search
  • Teachers expand_more
    • Early years
    • Primary
    • Secondary
    • Post-16
    • Events
    • Professional development
  • Students expand_more
    • Primary
    • Secondary
    • Post-16
  • Parents expand_more
    • Early Years
    • Primary
    • Secondary
    • Post-16
  • Problem-Solving Schools
  • About NRICH expand_more
    • About us
    • Impact stories
    • Support us
    • Our funders
    • Contact us
  • search

Or search by topic

Number and algebra

  • The Number System and Place Value
  • Calculations and Numerical Methods
  • Fractions, Decimals, Percentages, Ratio and Proportion
  • Properties of Numbers
  • Patterns, Sequences and Structure
  • Algebraic expressions, equations and formulae
  • Coordinates, Functions and Graphs

Geometry and measure

  • Angles, Polygons, and Geometrical Proof
  • 3D Geometry, Shape and Space
  • Measuring and calculating with units
  • Transformations and constructions
  • Pythagoras and Trigonometry
  • Vectors and Matrices

Probability and statistics

  • Handling, Processing and Representing Data
  • Probability

Working mathematically

  • Thinking mathematically
  • Developing positive attitudes
  • Cross-curricular contexts

Advanced mathematics

  • Decision Mathematics and Combinatorics
  • Advanced Probability and Statistics
  • Mechanics
  • Calculus

For younger learners

  • Early Years Foundation Stage
Age 16 to 18
Article by Alan and Toni Beardon

Published 1999 Revised 2011

Continued Fractions II

$\def \leftb{} \def \rightb{}$

In this article we shall see that every whole number can be written as a continued fraction of the form
$$ {k\over\displaystyle 1+ \leftb {\strut k\over \displaystyle 1+ \leftb {\strut k\over \displaystyle 1+ {\strut k\over \displaystyle 1+ ... }}\rightb}\rightb}.$$
Let us start with $k=6$. In the last article we showed you how to evaluate continued fractions.

Using this method with $k=6$ you should get the successive values
$$6, \ {6\over 7}, \ {42\over 13}, \ {78\over 55}, \ {330\over 133}, \ {798\over 463},...$$
Now write these fractions as decimals and you will see that the values are alternately above and below 2. If we continued this sequence we would see the fractions getting closer and closer to 2 and if you know how to do so you might like to write a program to give more terms of this sequence. We shall now show that the value of this infinite continued fraction is actually 2. Let $V$ be the value of the infinite continued fraction with $k=6$. Then $$V= {6\over 1+V}$$ so that $$V^2+V-6=0.$$ This factorises as $(V-2)(V+3)=0$ so that $V$ (which is positive) must be 2. We have now shown that the number 2 can be written as an infinite continued fraction. It turns out that to write the number 1 as an infinite continued fraction we need to take $k=2$. Following the method given above you will get the equation $V^2+V-2=0$. You should factorise this and show that $V=1$. Let us look at one more value of $k$ which gives $V$ as a whole number, and after that we will find a general formula for $k$ so that we can get $V$ to be any whole number. Now take $k=12$. This gives $V^2+V-12=0$ and hence $V=3$. Notice that in every case we get the equation $V^2+V-k=0$. However, not every value of $k$ gives $V$ as a whole number; for example $k=1$ leads to the Golden Ratio and $k=3$ does not give a whole number either. What is the value of $V$ when $k=3$? Let us try and see which values of $k$ give $V$ as a whole number. The solution of the quadratic equation $V^2+V-k=0$ is $$V={-1 \pm \sqrt{(1+4k)}\over 2}$$ and this will be a whole number when $1+4k$ is the square of an odd number. In the cases we have seen already $k=6$ and $1+4k=5^2$, $k=2$ and $1+4k=3^2$, and finally $k=12$ and $1+4k=7^2$. You should now be able to find $k$ so that $1+4k=9^2$ and $V=4$. What value of $k$ gives $V=5$? We began by saying that we shall show that every whole number can be written as a continued fraction of the form given above. This means that given a whole number $N$ there must be some value of $k$ such $V=N$. So which value of $k$ gives $V=N$? For $V$ to be $N$ we must have $$N={-1 \pm \sqrt{(1+4k)}\over 2}$$ or $$1+4k = (2N+1)^2.$$ This shows again that for $V$ to be a whole number, $1+4k$ must be the square of an odd number. Moreover given any whole number $N$, then by taking $k=N^2+N$ you get a continued fraction with the value $N$. Every number can be written as a continued fraction and continued fractions are sometimes used to give approximations to irrational numbers. See if you can show that $$1 \qquad + \leftb\qquad {1\over\displaystyle 2\;+\; {\strut 1\over \displaystyle 2\;+\; {\strut 1\over \displaystyle 2\;+\; {\strut 1\over \displaystyle 2\;+\; ... }}}}\rightb= \sqrt{2}.$$ This suggests that a good approximation to $\sqrt 2$ is given by $$1 \qquad + \leftb\qquad {1\over\displaystyle 2\;+\; {\strut 1\over \displaystyle 2\;+\; {\strut 1\over \displaystyle 2\;+\; {\strut 1\over \displaystyle 2\;+\; {\strut 1\over \displaystyle 2 }}}}}\rightb.$$ Find this as a fraction and check with a calculator to see how close it is to $\sqrt 2$.


You may also like

Good Approximations

Solve quadratic equations and use continued fractions to find rational approximations to irrational numbers.

There's a Limit

Explore the continued fraction: 2+3/(2+3/(2+3/2+...)) What do you notice when successive terms are taken? What happens to the terms if the fraction goes on indefinitely?

Not Continued Fractions

Which rational numbers cannot be written in the form x + 1/(y + 1/z) where x, y and z are integers?

  • Tech help
  • Accessibility Statement
  • Sign up to our newsletter
  • Twitter X logo

The NRICH Project aims to enrich the mathematical experiences of all learners. To support this aim, members of the NRICH team work in a wide range of capacities, including providing professional development for teachers wishing to embed rich mathematical tasks into everyday classroom practice.

NRICH is part of the family of activities in the Millennium Mathematics Project.

University of Cambridge logo NRICH logo