A curious question recently crossed my mind: can we construct decimal numbers of the form $$\text{"a.bcdefghij…"}$$ where each letter represents a digit $0-9$ (where the number may or may not be rational), so that it is equal to a continued fraction of the form $$a+\cfrac{1}{b+\cfrac{1}{c+\cfrac{1}{d+\cfrac{1}{e+\ddots}}}}$$

For example, I found that


Experimenting a bit, we see that we can certainly construct infinitely many numbers that are close solutions, but how can we make them the most efficient? To clarify, we prefer not to go too deeply nested into the continued fraction to make the previous digits work, because then we have to make those new digits work. So some questions are:

~What algorithm will construct such numbers?
~Does that algorithm construct numbers that are “efficient” as described above? Is there one number that is the "most efficient"?
~Does an exact non-repeating rational example exist?

  • 2
    $\begingroup$ Duplicate unanswered question: math.stackexchange.com/q/2044747/527345. $\endgroup$
    – noedne
    Apr 13, 2018 at 3:43
  • 2
    $\begingroup$ zeros do usually not occur in a continued fraction, except in the first entry. Nevertheless, a good example. $\endgroup$
    – Peter
    Apr 13, 2018 at 13:28
  • $\begingroup$ Very interesting! $(+1)$ $\endgroup$
    – Mr Pie
    Apr 13, 2018 at 13:36
  • 1
    $\begingroup$ Trott Constant $\endgroup$
    – Ed Pegg
    Jul 17, 2018 at 15:39
  • 3
    $\begingroup$ @EdPegg That link is broken now. Use Trott Constants instead $\endgroup$ Sep 18, 2020 at 13:15

1 Answer 1


A "correct" continued fraction does not contain any zeroes after the first digit. For example, [8;6,7,5,3,0,9] is not a valid continued fraction; the number that computes to will actually have a continued fraction of [8;6,7,5,12]. (This is because 3+1/{0+1/9}=3+9=12). The numbers before and after the zero are added together. Similarly, the continued fraction of the number 0.32062241134... actually begins [0;3,8,2,2,4,1,1,3...]

So, you might be able to generate a sequence of [a;b,c,d,e,...] that gives you a+(b/10)+(c/100)+(d/1000)+(e/10000)+... , but you will not be able to successfully reverse it. You can calculate the decimal digits from the continued fraction, but not the other way around, unless there is a solution that contains no zeroes.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .