There's an interesting trick to this; you can make a self-referential substitution
x=1+x1
It's a weird approach. It seems to work, however, as expanding it retrieves the original infinite fraction:
x=1+x1=1+1+x11=1+1+1+x111=⋯
Treating this substitution as valid, we get x2=x+1. Since our solution must obey x≥1, we quickly see that the solution of interest is our old friend, the golden ratio
ϕ=21+5=1+1+1+1+⋯1111
So, what did we get from this? It looks like we can approximate this infinite sum by truncating it at a finite number of iterations, which can be a new and interesting way to compute ϕ. These finite approximations will give us rational "convergents" which come arbitrarily close to the (irrational) answer. Let’s try doing just that
ϕ≈1,23,35,58,813,1321,⋯,233377,⋯
Notice that this converges to the correct value 1.618034, albeit a bit slowly. The slowest convergence possible with continued fractions, in fact (I'll hint at the proof here). In this sense you can claim that ϕ is the “most irrational number”, but that discussion is worthy of its own post. You may also notice that the numerator and denominator of each convergent are all consecutive members of the Fibonacci sequence. This isn’t an accident; we’ll get to that later.
An obvious next step would be to apply this same treatment to a generalized continued fraction (CF) of the form
x=n+n+n+n+n+⋯1111
making the same substitution x=n+x1 leads us to the quadratic equation x2=nx+1. Looking only at positive solutions leads us to
2n2+4+n=n+n+n+n+n+⋯1111
Since I'll be writing a lot of continued fractions here, it'll be easier if I introduce a shorthand for them:
Things are significantly simpler when n=2a. In that case you get the identity
a2+1=[a,2a,2a,2a,…]
So it seems that only a small portion of possible square-roots (2,5,10,17,26,37,…) have simple continued fractions like this. Let's start to look for more complex patterns.
To get an idea of what they look like, let's flip our approach and focus on the process of getting a continued fraction from a given value. We can start with the case of rational numbers p/q, with p and q coprime and p>q (if the converse holds, take the reciprocal and continue). We can expand them as a continued fraction through a modification of Euclid's algorithm. The idea is to repeat the following operation:
p=nq+r,r<q→qp=n+qr
In numbers, this is equivalent to saying something like 8/3=2+2/3. We're interested in applying this to all fractions, including the remainder r/q. Since it's always less that 1, we cannot repeat the process unless we take its reciprocal. Now we have q/r>1 which can be decomposed again. This continues until you have a remainder of 0 or, equivalently, you have a remainder of the form 1/a. Here's an example of this in action:
92/17=5+7/1717/7=2+3/77/3=2+1/3
The key to turning this into a continued fraction is to move back up the chain, taking the reciprocals of the decomposed reciprocals.
7/3=2+1/3→3/7=2+1/3117/7=2+3/7→17/7=2+2+1/3192/17=5+7/17→92/17=5+2+2+1/311
Because the denominator at each step is strictly smaller than that of the first (r<q), we know that this algorithm will always terminate for finite p and q. Thus, every rational number has a finite continued fraction. The converse holds as well, which means that any number r is irrational if and only if its continued fraction expansion is infinite. By now, we've essentially shown that n2+1 and n2+4 are irrational for all n>1. Not a bad result, but we're far more ambitious than that.
This algorithm can easily be extended to any real number α. You can check that this yields the same algorithm as above when α is rational.
α=⌊α⌋+(α−⌊α⌋)α−⌊α⌋1=α0=⌊α0⌋+(α−⌊α0⌋)…
I wrote a small program to find the CF expansions of several square roots using this algorithm. Here are some of its results:
Evidently, they all repeat as well, but in a periodic way (periodic continued fractions will always yield a quadratic, but we can't prove that until later). So, the fraction expansions we found earlier were effectively for continued fractions of period 1, limiting ourselves to a subset of possible square roots. There seem to be examples of every period of a given length as well, though most periods tend to be even. I'll expand our method of evaluating infinite continued fractions to periodic fractions for those with a period of 2, then outline a general method for higher periods.
We can write a basic period-2 continued fraction t as [0,a,b,a,b,…], or as
t=a+b+t11
Multiply the top and bottom of the fraction with b+t
t=at+ab+1b+tat2+abt=bt=2aa2b2+4ab−ab
Where we only look the the positive solution. This is guaranteed since a2b2+4ab−ab>0 for all positive b,a. We can extract some special cases where this is simplified:
So we now know the CF expansions of the square roots of (6,8,12,15,20,24,…), as they all have period-2 infinite continued fractions. But we know that there are more out there with higher periods, so we need to find a general way to find a CF given some fixed period.
For that period, n, we can start with t=[0,an−1,…,a1,a0,an−1,…]. We can focus on a sub-fraction of t, tn, which has the form
t1=1/a0tn+1=an+tn1
We have a recurrence relation which "builds" continued fractions from the bottom up, with a given sequence of numbers. Because this starts at a finite term and builds the fraction from there, we can really only use this as an approximating tool with periodic sequences. The goal now is to expand tn in terms of a0:
These are recurrence relations for the numerator and denominator of the convergents of the CF. Taking ϕ−1=[0,1,1,1,…] we have:
Fn=Fn−1+Fn−2q0=1,q1=1
Of course, this is just the Fibonacci sequence! The convergents of the CF expansion are given by tn=qn−1/qn, which we now know are just consecutive members of the recurrence relation above. Notice, however, that convergence seems a little slow. 12 terms still isn't enough for accuracy up to three decimal places! It turns out that the problem is that the Fibonacci sequence sets a lower bound for sequences of the type qn=an−1qn−1+qn−2 due to the fact that qn/Fn≥1. Due to this, the denominators of the convergents increase rather slowly. Compare this to a CF like 2−1=[0,2,2,…], where we have
Which converges far faster. This is essentially a result of the pigeonhole principle: as qn grows, the approximation becomes more accurate. Given some p/q and a real number σ, you can choose an integer p such that ∣p/q−σ∣<1/2q. In words, the rationals become arbitrarily close together as q increases. Fast-growing sequences will have a CF expansion which will converge more quickly than slow-growing ones. This means that ϕ, of all the irrational numbers, has the slowest-converging continued fraction. In some sense, this means that it is the "furthest" from every other rational number.
But let's get back to the general recurrence relations. There's still a bit more to say about them before I pose the true problem. We can use the substitution process we developed earlier and feed it into this recurrence relation. We have t=[0,an−1,…,a1,1/t].
q0=1q1=1/tq2=a0/t+1qn=An/t+Bn
Periodic continued fractions are always the solution of a certain quadratic equation! Now here's the challenge: For any quadratic equation with irrational solutions, can the positive solution be given as a periodic continued fraction - or a rational multiple of one? Can every quadratic number be written as a periodic CF?
Postscript: I did some calculations of common non-quadratic numbers using the algorithm above and got these results for their CF expansions.
This discussion board is a place to discuss our Daily Challenges and the math and science
related to those challenges. Explanations are more than just a solution — they should
explain the steps and thinking strategies that you used to obtain the solution. Comments
should further the discussion of math and science.
When posting on Brilliant:
Use the emojis to react to an explanation, whether you're congratulating a job well done , or just really confused .
Ask specific questions about the challenge or the steps in somebody's explanation. Well-posed questions can add a lot to the discussion, but posting "I don't understand!" doesn't help anyone.
Try to contribute something new to the discussion, whether it is an extension, generalization or other idea related to the challenge.
Stay on topic — we're all here to learn more about math and science, not to hear about your favorite get-rich-quick scheme or current world events.
Markdown
Appears as
*italics* or _italics_
italics
**bold** or __bold__
bold
- bulleted - list
bulleted
list
1. numbered 2. list
numbered
list
Note: you must add a full line of space before and after lists for them to show up correctly
Easy Math Editor
This discussion board is a place to discuss our Daily Challenges and the math and science related to those challenges. Explanations are more than just a solution — they should explain the steps and thinking strategies that you used to obtain the solution. Comments should further the discussion of math and science.
When posting on Brilliant:
*italics*
or_italics_
**bold**
or__bold__
paragraph 1
paragraph 2
[example link](https://brilliant.org)
> This is a quote
\(
...\)
or\[
...\]
to ensure proper formatting.2 \times 3
2^{34}
a_{i-1}
\frac{2}{3}
\sqrt{2}
\sum_{i=1}^3
\sin \theta
\boxed{123}
Comments
There is some more discussion in the wiki.