This is a continued fraction:

To evaluate it, just simplify from the bottom up. That one comes out to 225/157.
For the rest of this, I’m going to use the following notation: 225/157 = [1,2,3,4,5].
Each number has a unique continued fraction (as long as you don’t use 0), and the rational numbers all eventually terminate.
But what about irrational numbers? Like, take √2. What’s the continued fraction for that? Well, it ends up being [1, 2, 2, 2, 2, 2, 2, …], with infinite 2s coming after the 1. The notation for this is [1, {2}].
Why is that √2? Well, let’s consider just [{2}].

How would you find the value of this?? The trick is that it contains itself.

x = 2 + 1/x means x² – 2x – 1 = 0. That can be easily solved to x = 1 ± √2. Wait, plus or minus? So it could be two different numbers? No. In what world would the value of that be negative?
Anyways, since that is 1 + √2, we just subtract 1 from it to get the continued fraction of √2.
Every irrational square root has a repeating continued fraction like that. Here’s the first several of them:
√2 = [1, {2}]
√3 = [1, {1, 2}]
√5 = [2, {4}]
√6 = [2, {2, 4}]
√7 = [2, {1, 1, 1, 4}]
√8 = [2, {1, 4}]
√10 = [3, {6}]
√11 = [3, {3, 6}]
√12 = [3, {2, 6}]
√13 = [3, {1, 1, 1, 1, 6}]
√14 = [3, {1, 2, 1, 6}]
√15 = [3, {1, 6}]
√17 = [4, {8}]
√18 = [4, {4, 8}]
√19 = [4, {2, 1, 3, 1, 2, 8}]
√20 = [4, {2, 8}]
Notice any patterns? No? Well, there aren’t a lot of patterns to notice. The first one is that the non-repeating section is always just the next square down. That makes sense. But the repeating section always ends with twice that. And if you ignore the last one, the repeating section is always a palindrome! Why? I don’t know the answer to that myself.
As well, the square roots that are one above a square have length-1 repeating sections.
In other words, √(n²+1) = [n, {2n}]. Here’s some other similar patterns I’ve noticed:
√(n²+2) = [n, {n, 2n}]
√(n²+4) = [n, {n/2, 2n}] (provided n is even)
√(n²+n) = [n, {2, 2n}]
√(n²-2) = [n, {1, n-1, 1, 2n}]
√(n²-1) = [n-1, {1, 2n-2}]
But wait, there’s more! The first three are special cases of a more general rule:
√(n²+k) = [n, {2n/k, 2n}] (of course, this only works if 2n/k is an integer)
That covers a lot of them, but it still doesn’t explain a lot of things, like why are they all palindromes??
Let’s move on from square roots for now. What about continued fractions that don’t repeat at all?
Like this one: [{k}] = [1, 2, 3, 4, 5, 6, 7, 8, …] ≈ 1.43313. I don’t know what that is. (I hope you understand the notation. k starts at 1.)
There are some that are reasonable values, like e = [2, 1, {2k, 1, 1}]. Or [{2k-1}] = (e²+1)/(e²-1). But most of them are just, who knows.
How about [{k, 2k}]?

It’s approximately equal to 1.40848097, and I swear I’ve seen that number before, but I can’t remember from where, and I can’t find it online anywhere. If someone knows a closed form for this number, please let me know.
Anyways, that was an exploration of continued fractions! I didn’t really know where I was going with it, but I ended up here.










