### Continued fractions; LaTeX Trial

#### by landonlehman

I am hoping to be able to use code for future blog posts, so this post is just to see how it works. The content is not original – I recently read about continued fractions in The Princeton Companion to Mathematics (a book that I highly recommend to anyone interested in math).

First of all, what are continued fractions? The easiest explanation is by way of constructing an example. Take the all-important transcendental number . The leading integer will be the first number in the continued fraction, so subtract it. We are left with . Now take the reciprocal of this number: . Again use the leading integer for the continued fraction and subtract it from the original number (), giving . Take the reciprocal of this number and repeat the process ad infinitum to generate the continued fraction for :

Several notes:

- This is a sloppy, non-technical way of explaining the algorithm for obtaining a continued fraction. What is really going on is the use of a certain form of the Euclidean algorithm for division. But this is an easy way to get started actually writing down a continued fraction.
- The above formula took some time to input using and is very error-prone. Since the numerator of each fraction is always (aside from the initial integer), we can compress the notation as follows: . Semicolon after the initial integer part; commas after that.
- (Note promoted to part of main text).
- The at the end of the continued fraction signify that the fraction does not terminate. This is because is not a rational number. In general, rational numbers have finite continued fractions (i.e. the algorithm will terminate eventually) and irrational numbers have infinite continued fractions (which may or may not be periodic).

(3) I was going to say that the continued fraction for does not have a simple form, because is transcendental and all that. But the continued fraction form of actually contains a very interesting pattern. Let’s look at some more digits using the compressed notation:

See the pattern? If not, drop the initial and write the remaining numbers in groups of three. The outer two numbers in each triplet are always , while the middle number starts at and increases by in each successive triplet. More digits can be found here (hey look – one of my links was actually useful 🙂 ). I don’t know the explanation for this pattern, but it would be very interesting to find out whether it is just some numerical coincidence or if it points to some more fundamental property of .

Well, I think I figured out how to use in WordPress. I picked at random for an illustration of continued fractions and found out about the cool pattern while I was writing up the post. So I didn’t get to what I wanted to talk about, but that’s ok because I learned something new! This post is plenty long, so I will conclude with a preview of what I originally planned to discuss: Cutting off the continued fraction of an irrational number provides a (rational) approximation to that number – you can perhaps imagine how you might go through some standard but lengthy algebraic manipulations to get a single “normal” fraction out of any finite continued fraction. There is a well-defined way in which this approximation is the “best” approximation to the original number. And out of all the continued fraction approximations of all the irrational numbers, the number that is most difficult to approximate in this manner turns out to be very interesting.

More to come!

[…] in the first post on continued fractions, I found out about an interesting pattern in the continued fraction of , but didn’t get to my […]