Mathematicians have achieved a major step towards answering the question of whether numbers like pi and other mathematical constants are truly random and for the first time linked number theory with chaos theory.

It is not just a mathematical curiosity they say. Proving that pi never repeats itself would be a major advance in our theory of numbers.

It may also allow the construction of unbreakable codes based on long sequences of random numbers.

The value of pi is known to 500 billion places. No cyclic patterns have been found and if mathematicians are correct none will ever be found no matter how many digits are calculated.

Hypothesis A

Pi, the ratio of a circle's circumference to its diameter, has been known for thousands of years to be mystifying. Some ancient Greeks built a religion around it.

Pi is a ubiquitous number whose first few digits are the well-known 3.14159. Pi will go on forever┐

All numbers of the same number of digits inside pi occur with the same frequency: 234 appears as often as 876, and 23,568 as often as 98,427. Mathematicians call such a number that behaves this way "normal".

Other normal numbers are the square root of 2 and the natural logarithm of 2.

According to David Bailey, of the Lawrence Berkeley National Laboratory in the US, the normality of certain maths constants is a result of some reasonable conjectures in the field of chaotic dynamics.

Chaotic dynamics states that sequences of numbers of a particular kind dance between two other numbers - a conjecture called "Hypothesis A".

Still with me?

The fact is that not a single instance of a number like pi has ever been proved normal. Mathematicians, it seems, are pretty fed up that they cannot do this.

This is where Hypothesis A comes in and a strange discovery made six years ago.

That discovery was made by David Bailey and Canadian mathematicians Peter Borewin and Simon Plouffe. They wrote a computer program that calculates an arbitrary digit of pi without calculating any of the preceding digits - something that was thought impossible.

The connection between BBP and Hypothesis A is that the BBP program produces just the kind of behaviour that the hypothesis predicts.

Bailey says: "At the very least we have shown that the digits of pi appear to be random: because they are described by chaos theory."

Practical spin-offs of this seemingly arcane research include random number generators and cryptography.