Talk:Continued fraction

Ordinary arithmetic operations on continued fraction representation
While the representation of numbers as continued fractions is very pretty, I wonder how we do basic arithmetic operations like addition, subtraction, multiplication, and division directly in this form, without having to resort to converting them to ordinary fractions. I feel that the usefulness of this article can be greatly enhanced by this inclusion. Manoguru (talk) 18:22, 17 December 2019 (UTC)

"Complete convergent"?
The paper patz5.pdf cited under Pell's equation says on page 2:
 * ... If $$x_n = (P_n + \sqrt{D}) / Q_n$$ is the n-th complete convergent of the simple continued fraction for $$\omega = (P_0 + \sqrt{D}) / Q_0$$, ...

but I can't find any definition of complete convergent. Is it just another name for a complete quotient? If it is, perhaps someone sufficiently knowledgeable could mention it in that page. Hv (talk) 13:46, 22 May 2021 (UTC)

Requires citations and clarifications
This is a long article; and I jumped in to the "Examples" section. The table completely mystified me, in terms of "how do I get from the 'stuff' in the table to a continued fraction?" What I'm getting at is that the column and row headings are neither descriptive nor described -- at least a quick definition of terms or a "For example, using the table able, we can generate pi with the following continued fraction. Notice how the values correspond to the table entries ."

The citation that I'd like is one in the "History" section, where it states, "300 BCE Euclid's Elements contains an algorithm for the greatest common divisor which generates a continued fraction as a by-product" -- unfortunately, neither hotlink "Euclid's Elements" nor "greatest common divisor" leads me to text that deals with the "greatest common divisor which generates a continued fraction as a by-product" goal that I was looking for. Each leads me to its respective "narrow" definition, but nothing leads me to the overall concept about how GCD relates to continued fractions. 198.84.205.118 (talk) 00:03, 29 May 2021 (UTC)
 * I have edited the first item of section "History", and added in section "Motivation and notation": "The sequence of the integers that occur in this representation [of a rational numbers by a continued fraction] is the sequence of the successive quotients that are computed by the Euclidean algorithm". D.Lazard (talk) 08:32, 29 May 2021 (UTC)

Too hard formula represented on article
Correct formula for programming conversion $$a/b$$ to continued fraction is very simple and like this within loop:

an1 := an0 / bn0; // integer div (you need this $$a_n$$) bn1 := an0 % bn0; // integer mod an0 := bn0; bn0 := bn1;

Mvitaminus (talk) 23:28, 2 June 2021 (UTC)

Division by zero
The article currently indicates "where $a_{i}$ and $b_{i}$ can be any complex numbers." Before we required $b_{i}$ to be 1 -- because we were defining a simple continued fraction before -- and we also required that $a_{i}$ be a positive integer. As a consequence, this prevented division by zero in every convergent. The current definition has no such safeguard. Should it? — Q uantling (talk &#124; contribs) 17:21, 2 May 2022 (UTC)

Reciprocal of 1
The article suggest that the reciprocal of a number is given by adding/removing a zero at the begining. It is not true for 1 or -1 since their reciprocals are themselves. 2601:648:8601:93A0:AC29:71C5:7EE0:6ABA (talk) 06:55, 13 December 2022 (UTC)


 * Did you work out the value of the continued fraction obtained when you add a zero at the beginning for these numbers? Remember that continued fraction representations are not always unique. —David Eppstein (talk) 07:01, 13 December 2022 (UTC)

The golden ratio is not the most irrational number.
If you use square roots, instead of fractions, you can get something more irrational than the golden ratio, because many square roots already become irrational with 1 iteration, which does not apply with fractions.

example: 3+sqrt(7+sqrt(15+sqrt(1+sqrt(292+sqrt(... 84.151.244.169 (talk) 15:07, 8 May 2023 (UTC)


 * I don't think that there is a precise meaning for "most irrational number". The point in the article is to highlight that the continued fraction expansion of the golden ratio $φ$ is all ones.  It turns out that this means that regardless of the fraction $p/q$, it is the case that the value $(|φ − p/q|) × q2$ is large in comparison to what can be achieved with rational approximations for other irrational numbers.  — Q uantling (talk &#124; contribs) 16:20, 8 May 2023 (UTC)

Revamping the page
Hello!

I just wanted to check in with anyone that might care whether or not they'd take issue with me trying to reorganise the page. I've become quite interested in continued fractions not just as a weird means of 'calculating numbers', but as an alternate means of representing numbers between the integers to that of the usual decimal 'negative power series', and I'd really like to try to do justice to them through updating the page.

Some notes I've taken thus far as as follows:

- Motivation and Notation section spends a lot of time explaining how to calculate the continued fraction form from usual decimal negative power series form, not enough time talking about actual motivations/history/desirability, and the notation. Either I can change the name and collate related information or remove from this section and write a clearer explanation of the method elsewhere, preserving Pier4r's request above.

- Whole separate Notation section exists, which actually discusses 'alternative notations' to the ones presented in the 'motivation and notations section'; I think this heading should be changed and it should be subsumed by a broader section on notation.

- Repeated references throughout to the effect of "sqrt(2) actually equals 1.41421..., so you can calculate this from its continued fraction form [1;2,2,2,..] by doing so and so." Seems to be a neglect for the consideration of a continued fraction representation of a number as equally 'valid' as the power series representation, probably due to unfamiliarity and the somewhat cumbersome but necessary notation. To be clear, I think there's little reason to not switch the notation such that for example pi = 3.7(15)1(292)111213... (in continued fraction form) = [3;1,4,1,5,9,2,6,..] (in power series form) -- now imagine analogously saying that " pi actually = 3.7(15)1(292)111213..., so you can calculate this from its power series form via... ". I personally think it's reductive and unnecessary, so I wonder what you guys might think of this point in particular.

- The continued fraction notation version of a bunch of mathematical constants in the Motivation and Notation section seems really helpful to me for familiarising the reader with this perspective on these numbers, and I would like to preserve something similar, but when you look for its context you see that all this space is actually serving to elucidate infinite continued fractions, which is off-topic from the heading. I'd like to flesh out some of these kinds of examples with more numbers that aren't just infinite cfs, and reserve discussion of infinite cfs for maybe the section 'Infinite continued fractions and convergents'.

- Notice that there's no mention nor use of the 'repeating' notation usually seem with 'decimal' notation of numbers like 1/3 or 1/7, only ellipsis like sqrt(3) = [1;1,2,1,2,1, 2,...]. I'd like to explicitly incorporate that.

- Having read the page quite a few times, I'm confused as to whether it's about cfs in the canonical form or the generalised form. Given that a page exists solely for the generalised form, I'd be inclined to dedicate this to the canonical form, but I also feel that that would be too specific and might mislead people given the name. The diagram in the introduction shows it in the canonical form, mention of definition as 'the reciprocal of another number' somewhat suggests the understanding that it's about the canonical form, the intro makes the delineation between the two and suggests a prioritisation of the canonical form, yet the section on Basic Formula immediately jumps into the generalised form, despite that formula being mirrored on the generalised cf's page. That formula is then repeated in the later section titled 'generalized continued fraction(s?)', which I feel again is redundant and I'd like to remove and possibly move over any interesting information to its respective article if it's not there already.

There's more I'd like to add, including some interesting patterns I've found myself, some restructuring to be done, and more I need to study in order to be able to really speak on some topics. I'd like to ensure I'm factoring in the suggestions that others have already made too, and in particular I'd love to be able to address Manoguru's concerns about the natural operations of numbers in continued fraction form, but that's all I can speak on for now.

Please do let me know your thoughts on my potential changes, thank you for reading if you made it this far! CallumMScott (talk) 14:17, 14 August 2023 (UTC)

how "larger term" better approximation
I don't like the sentence
 * The larger a term is in the continued fraction, the closer the corresponding convergent is to the irrational number being approximated.

It goes on to explain that the golden ratio is the hardest to approximate because all terms of its continued fraction are "1".

I think what the sentence should say is something like "the larger a term is, the more that one term improves the approximation." But then I want to natter on about percentage reduction in absolute error.

I would like to hear from someone who understands the article before I try to "improve" it.

Jmichael ll (talk) 20:41, 8 November 2023 (UTC)


 * Which is closer to 4: 4$1/7$ or 4$1/3$?
 * The greater a partial quotient is, the less effect it and its successors have on the number; in other words, the more accurate the fraction already is. —Tamfang (talk) 05:32, 15 November 2023 (UTC)
 * Perhaps I'm mistaken in this concern, but isn't there a problem about what we mean by "the corresponding convergent"? Would it be an improvement to add a "next", as in
 * The larger the next term in the continued fraction is, the closer a convergent is to the irrational number being approximated.
 * I think both are true and mean slightly different things. Dhrm77 (talk) 15:40, 15 November 2023 (UTC)
 * I think both are true and mean slightly different things. Dhrm77 (talk) 15:40, 15 November 2023 (UTC)

Constructive observation
A real number $$x$$ has an infinite continued fraction expansion iff it is apart from all rationals: $$\forall q:\Q.\exists m:\N +. |x-q| \geq (1/m)$$. This is constructively stronger than being irrational (not rational).

46.33.143.125 (talk) 15:52, 28 January 2024 (UTC)


 * What does "apart from all rationals" mean, if not "irrational"? —Tamfang (talk) 17:28, 27 March 2024 (UTC)
 * Constructively, "apart" has a stronger meaning than "not equal". Two numbers are "apart" if they differ by at least some $1/n$. 46.33.143.125 (talk) 19:04, 13 April 2024 (UTC)
 * Can you give an example of an irrational number which is not "apart" from the rationals? –jacobolus (t) 19:37, 13 April 2024 (UTC)
 * What is an example of an irrational that has a finite neighborhood containing no rationals?? —Tamfang (talk) 21:07, 13 April 2024 (UTC)
 * The definition in the top comment here lets you pick a different neighborhood excluding each rational number. But I don't understand what's different about it than the concept of "irrational" per se. –jacobolus (t) 22:22, 13 April 2024 (UTC)