The fraction is a good approximation to the irrational number : so much so that it is celebrated in Pi Approximation Day on 22 July. But have you ever wondered how to calculate rational approximations to irrational numbers?

The answer comes from *continued fractions*: these are a nested series of fractions that can reveal hidden properties of numbers. Any number can be written as a continued fraction. Rational numbers (including integers) can be written as finite continued fractions: for example

*good*approximation of an irrational number if there isn't a fraction that is closer to with a smaller denominator . And the continued fraction expansion of an irrational number gives the best series of approximations in this sense, for an irrational number.

The first few approximations of produced in this way:

very quickly get close to the true value of . Their differences from are approximately:

If you count the curves of seeds spiralling in a sunflower you'll find pairs (counting spirals curving left and curving right) that are (almost always) neighbours in the Fibonacci series, all approximations of . | ||

But not all approximations work so well for irrational numbers. For example, the approximations from the continued fraction of (the limit of the ratio of successive Fibonacci numbers – you can read more here) are:

*badly approximable*. You can tell something is badly approximable if the numbers in its continued fraction are bounded (they don't ever exceed some fixed number) and this is a measure of how irrational they are. In fact, is the most irrational number, with the numbers in its continued fraction never exceeding 1:

You can read more about continued fractions in John D Barrow's article, Chaos in Numberland: The secret life of continued fractions.

Return to the *Plus* advent calendar 2016.

This article comes from our *Maths in a minute library*.