The digits of pi reciting contest is an all-too-common Pi Day event. And as this year is a once-in-a-century confluence of month/day/year with the first few decimal digits of pi, we might be in for more of those than usual. Our 10 fingers make decimal digits a natural choice, but if we were capybaras or the Simpsons, we might use base 8. If we were ancient Mesopotamians, we would use base 60. Memorizing the digits in any of these bases is a bit arbitrary. The decimal, octal, and sexagesimal digits of pi don't capture the true essence of pi-ish-ness. Why not have a contest that has all of the rote memorization fun of decimal digit recitation with none of the arbitrary base dependence? That's right, this year you need to have a continued fraction reciting contest!

"Sounds great," I can hear you saying, "but what does that mean?" I'm glad you asked! A couple years ago, I blogged about continued fractions, the most romantic way to represent numbers. As I wrote then, a continued fraction is like a fraction but more so. Instead of stopping with one number in the numerator and one in the denominator, the denominator has a fraction in it too. And the denominator of that fraction has a fraction in it, and so on.

To standardize continued fractions, we require every numerator to be 1 and every denominator to be positive. (We'll also allow ourselves to add an arbitrary positive or negative integer to the front of the continued fraction, so we can represent numbers that are not between 0 and 1.) A continued fraction that follows all our rules, sometimes called a "simple" continued fraction.

With these restrictions, every number has a (basically) unique continued fraction representation. If the number is rational, the continued fraction eventually terminates. If it's irrational, the continued fraction continues forever.

Although we write the denominators of continued fractions using decimal notation, continued fractions are not base dependent. 12 is the same number whether we write it as 12 base 10 (decimal), 1100 base 2 (binary), or C base 16 (hexadecimal). So if twelve is in the denominator of a continued fraction, it doesn't matter what base we write it in. The continued fraction representation of a number has the same numbers in it, perhaps written a different way, no matter what base we use.

The continued fraction expansion of a number x tells us which rational numbers, or fractions, are the best approximations of x. When we truncate the continued fraction after a certain number of terms, we get what is called a convergent to x. If the convergent has the denominator n, that means no number with a smaller denominator than n is closer to x. Convergents are best approximations in an even stronger sense, but that's a topic for another time. Suffice it to say that convergents are the best of the best approximations, the cream of the approximation crop.

For a concrete example, let's look at the number pi. The continued fraction for pi is: