Can you write \[1+\cfrac{1}{2+\cfrac{1}{3+\cfrac{1}{4}}}\] as a more traditional fraction?

We can work through this ‘from the bottom up’. We have \[1+\cfrac{1}{2+\cfrac{1}{3+\cfrac{1}{4}}}=1+\cfrac{1}{2+\cfrac{4}{13}}=1+\cfrac{13}{30}=\dfrac{43}{30}.\]

Can you express \(\frac{45}{16}\) as a continued fraction?

\(\frac{45}{16}\) is equal to \(2\) ‘and a bit’. So taking \(a_{0}=2\) we have \[\frac{45}{16}=2+\cfrac{13}{16}.\] Writing \(\frac{13}{16}\) as \(\frac{1}{\textrm{something}}\) gives us \[\frac{45}{16}=2+\cfrac{1}{\left(\frac{16}{13}\right)}.\] If we now repeat the process we have that \[\frac{45}{16}=2+\cfrac{1}{\left(\frac{16}{13}\right)}=2+\cfrac{1}{1+\cfrac{3}{13}}=2+\cfrac{1}{1+\cfrac{1}{\left(\frac{13}{3}\right)}}=2+\cfrac{1}{1+\cfrac{1}{4+\cfrac{1}{3}}}.\]

Can you find a continued fraction to represent \(\sqrt{3}\)?

We know that \(\sqrt{3}\) is equal to \(1\) ‘and a bit’. Writing it in the form of a continued fraction we have \[\sqrt{3}=1+\frac{1}{x},\] where \(\dfrac{1}{x}=\sqrt{3}-1\). Therefore \[x=\dfrac{1}{\sqrt{3}-1}=\frac{\sqrt{3}+1}{2}\] by rationalising the denominator.

Now, returning to the continued fraction we can write \[\sqrt{3}=1+\cfrac{1}{\Bigl(\cfrac{\sqrt{3}+1}{2}\Bigr)}.\]

Now since \(1<\sqrt{3}<2\), we have that \(1<\dfrac{\sqrt{3}+1}{2}<1\frac{1}{2}\) so we can write \[\sqrt{3}=1+\cfrac{1}{1+\frac{1}{y}},\] where \(\dfrac{1}{y}=\dfrac{\sqrt{3}+1}{2}-1=\dfrac{\sqrt{3}-1}{2}\), giving \[y=\dfrac{2}{\sqrt{3}-1}=\sqrt{3}+1\] by rationalising the denominator.

Returning to the continued fraction we can now write \[\sqrt{3}=1+\cfrac{1}{1+\cfrac{1}{1+\sqrt{3}}}.\]

We now have \(\sqrt{3}\) at the bottom and we are ‘back to the start’. So if we write \(\sqrt{3}\) in the continued fraction as \(1+\dfrac{1}{1+\cdots}\), we get the result \[\sqrt{3}=1+\cfrac{1}{1+\cfrac{1}{2+\cfrac{1}{1+\cfrac{1}{2+\cfrac{1}{1+\dotsb}}}}}.\]

Is it easier to find the number represented when the continued fraction is finite or infinite?

This depends very much on the particular case. There is something very comforting about a finite continued fraction and knowing that we can always start ‘from the bottom’ and follow a set procedure. This can take a long time if the continued fraction is something like \[2+\cfrac{1}{1+\cfrac{1}{3+\cfrac{1}{2+\cfrac{1}{4+\cfrac{1}{7}}}}},\] but the process is not very difficult.

On the other hand, as we saw in Staircase sequences, an infinite continued fraction can be fairly easy to work with if we can see a repetitive pattern. Unfortunately, the repetitive pattern does not always reveal itself as quickly as it did in this example. If we had considered the continued fraction for \(\sqrt{7}\) the repeating pattern takes much longer to become clear \[2+\cfrac{1}{1+\cfrac{1}{1+\cfrac{1}{1+\cfrac{1}{4+\cfrac{1}{1+\cfrac{1}{1+\cfrac{1}{1+\cfrac{1}{4+\dotsb}}}}}}}},\] and is consequently more of a handful to deal with!

Continued fractions like this can be quite cumbersome to write down. There is a shorter way of recording the information about a continued fraction, for example \[2+\cfrac{1}{1+\cfrac{1}{2+\cfrac{1}{4}}}\] can be recorded as \([2;1,2,4]\).

The cumbersome continued fraction for \(\sqrt{7}\) can now be represented as \([2;\overline{1,1,1,4}]\).

We also cannot assume that all infinite continued fractions will be repetitive. For example we could have something like \[1+\cfrac{1}{2+\cfrac{1}{3+\cfrac{1}{4+\dotsb}}},\] which is much less obvious.

What types of numbers produce finite continued fractions? What about infinite continued fractions?

From what we’ve seen so far it looks as though rational numbers produce finite continued fractions and irrational numbers produce infinite continued fractions.

A finite continued fraction must correspond to a rational number, because we can always work ‘from the bottom up’ (as in the first mini-question above).

This tells us that if an irrational number has a continued fraction, then that continued fraction must be infinite.

But could there be rational numbers that also have infinite continued fractions?

It would be rather hard to start with an infinite continued fraction and hope to show somehow that it corresponds to an irrational number (how would we show that it’s irrational?). Instead, we could show that a rational number must always give a finite continued fraction, and then that will tell us that infinite continued fractions must correspond to irrational numbers.

If we take a rational number, then we have a process for turning it into a continued fraction, as illustrated in question 2 above.

At each stage, we replace one rational number by another and then repeat the process. Each time we do this, the new rational number has a denominator that is strictly smaller than the denominator of the previous one.

To help see why this is true, you could look back at question 2 or another example.

But the denominator is a positive integer, so the process cannot continue forever.

So we must obtain a finite continued fraction.

We have seen that a rational gives a finite continued fraction, and that a finite continued fraction corresponds to a rational number, so it must be the case that infinite continued fractions correspond to irrational numbers.

Which numbers are easier to express as continued fractions? Why?

Can every irrational number be written as a continued fraction?

This question is very similar to question \(4\). If we start with a rational number then we know that we can go through the routine as in question \(2\). We may not know how long we will have to repeat this process at the start but at least we can dive in with the certainty that it will finish at some point!

If we start with an irrational number then we can still follow a set procedure, but the continued fraction will be infinite.

Sometimes, as in the case of \(\sqrt{2}\) and \(\sqrt{3}\), the continued fraction eventually starts to repeat, but this is not the case for every irrational number. Indeed, we can simply write down a continued fraction that does not repeat, such as \[1 + \cfrac{1}{2 + \cfrac{1}{3 + \cfrac{1}{4 + \cfrac{1}{5 + \dotsb}}}}.\]

We were able to find the continued fractions for \(\sqrt{2}\) and \(\sqrt{3}\) using our knowledge of their definition (the property of \(\sqrt{2}\) that we used is that its square is \(2\)—that meant that we could rationalise the denominator using the difference of two squares). That becomes more difficult for irrational numbers with more complicated definitions, such as \(\pi\). The number \(\pi\) still has a continued fraction, but in order to find it we might need to use its decimal expansion (to some number of decimal places) and then we can find only the first few terms of the continued fraction expansion. It turns out that \[\pi=3+\cfrac{1}{\left(\frac{1}{0.14159265359\dots}\right)}=3+\cfrac{1}{7+\cfrac{1}{\left(\frac{1}{0.06251330593\dots}\right)}}=3+\cfrac{1}{7+\cfrac{1}{15+\cfrac{1}{\left(\frac{1}{0.9965944067\dots}\right)}}}.\]