What is known about the infinite continued fraction

$$1 + \cfrac{1}{4 + \cfrac{1}{9 + \cfrac{1}{16 + \cdots}}} $$

whose terms include all perfect squares in order?

Do we have a closed form expression for the value of this number? Is it known to be transcendental, or satisfy any other interesting properties?

  • $\begingroup$ It's 1.2432884784... $\endgroup$
    – Kenta S
    Apr 18, 2020 at 23:22
  • 2
    $\begingroup$ Here is an approximation I found where $C_2$ is the twin prime constant believe it or not: $$(\ln(5))^{C_2\ln(2)}-\frac{1}{3051506330903478^{1/2}}$$ accurate to $25$ decimal places. $\endgroup$
    – Mr Pie
    May 1, 2020 at 15:09
  • 1
    $\begingroup$ But without fancy constants or too much force, I'd say it's approximate to $\dfrac{5\times 7^{3/4}}{12\sqrt [3]{3}}$ $\endgroup$
    – Mr Pie
    May 1, 2020 at 15:24
  • 1
    $\begingroup$ Let your number be $x$. See the A073824 (decimal expansion of $\dfrac{1}{x}$). Your number is, in other words, given by the following expression (when $n\to\infty$): $$ x_n=\dfrac{n^2a(n-1)+a(n-2)}{n^2b(n-1)+b(n-2)}\to x $$ Where $a(1)=1,a(2)=5$ for numerator and $b(1)=1,b(2)=4$ for the denominator. They are given in A036246 (numerators of $x_n$) and A036245 (denominators of $x_n$). These recursions do not have a closed form, it seems. $\endgroup$
    – Vepir
    May 7, 2020 at 15:02
  • 1
    $\begingroup$ The question of transcendentality is an interesting one — the growth rate of the continued fraction coefficients is too small to make this a Liouville number, but the regularity of struture here may still allow for one of the classic methods of proving transcendality to go through. For instance, the similar number where the terms of the CF are the positive integers (rather than the squares thereof) is known to be transcendental. $\endgroup$ May 7, 2020 at 20:20

4 Answers 4


Would you like $$\frac{138064447330372928950478420048463661504907828497126087600678688613823206940 422174}{1110477976182011935299028840335867265791530004627377300038704099001263 79105352933}$$ obtained after $35$ levels. Its decimal representation is $$1.24328847839971564408249654539442949923120026119744688506649745988163 032233825$$ which is not recognized by inverse symbolic calculators but, thanks to a friend of mine who enjoys this kind of problems is "close" to $$\frac{\exp\left(-\frac{10}{11}+\frac{35}{11 e}+\frac{57 e}{11}+\frac{49}{11 \pi }-\frac{18 \pi }{11} \right)\, \pi ^{\frac{4-39e}{11}}}{\sin ^{\frac{9}{11}}(e \pi ) }$$ corresponding to a relative error of $1.72\times 10^{-20} \text{ %}$

  • $\begingroup$ Calculating to more levels (200) it's clear that's not the actual value, but it's quite close. 200 levels matches with the expression with 21 digits. $\endgroup$
    – Gareth Ma
    Apr 30, 2020 at 22:26
  • 1
    $\begingroup$ Also just wondering, can you ask your friend how he got that crazy expression? Very curious $\endgroup$
    – Gareth Ma
    May 1, 2020 at 1:28
  • $\begingroup$ This comes from one of my friends who enjoys this kind of stuff (when he was my PhD student, on his spare time, he started building a sofware which, based on a few numbers and a lot of heuristics, tries to find an approximation). Crazy is the right word ! $\endgroup$ May 1, 2020 at 1:47
  • 1
    $\begingroup$ @ClaudeLeibovici: Would that former PhD student be Robert Munafo ? $\endgroup$
    – Lucian
    May 11, 2021 at 11:52
  • 1
    $\begingroup$ @Lucian. Not at all. But I know several guys who are really fanatic of this kind of things. When I saw this problem, I asked him to find something with only $e$ and $\pi$. What is funny is the $11$. By the way, it seems to me that you have been absent on the site for quite a long time. If this is true, are you OK ? and welcome back. Cheers :-) $\endgroup$ May 11, 2021 at 12:03

This is not an answer, but I cannot fit this in a comment. I'll remove this when it's not useful.

I wrote a code to numerically compute this. Go to https://sagecell.sagemath.org and enter this code:

t = continued_fraction([i ^ 2 for i in range(1, 1 + 500)]) # 500 levels
x = t.value().n(100000) # 100000 significant digits
print (x) # Decimal of 500 levels

Change the value 500 to a larger number for more levels, though you might need to change the $100000$ as well.

First few digits: (matches with the 600th level)


Time to think of the math :D

  • $\begingroup$ It is useful ! (+1) $\endgroup$ May 1, 2020 at 1:26
  • $\begingroup$ lol thank you :D (Sage is op) $\endgroup$
    – Gareth Ma
    May 1, 2020 at 1:27

Every irrational number $\ > 1\ $ is expressed in a unique way as a simple infinite continued fraction

$$a_0 + \cfrac{1}{a_1 + \cfrac{1}{a_2 + \cfrac{1}{a_3 + \cdots}}} $$

where every $\ a_k\ $ is a positive integer.

(It follows that the continued fraction from the OP's question is irrational).

And no other real number $\ > 1\ $ (i.e. no such rational number) ca be represented as a simple infinite continued fraction.


REMARK 1  One can easily formulate similar theorems for all positive irrational numbers or even for all non-zero irrational numbers, as well as for all irrational numbers between $\ 0\,$ and $\,1$. Each of such spaces (under the induced Euclidean topology) is homeomorphic to the topological (Tikhonov) Cartesian power $\ \Bbb Z^\Bbb Z.$


It is also very well known that the OP's fraction is not a quadratic irrationality because quadratic irrationalities are represented by eventually (including pure) periodic sequences $\{a_n\}_{n=1}^\infty$.

REMARK 2   The characterization of the purely periodic continued fraction was quite hard; it was done by Evariste Galois himself! (not to many people no about it but number-theorist -- ok, I am not one of them :) ).

  • $\begingroup$ If it is rational, the period will be larger than 10^10000 by the way, but I wonder if it can be proven that it's irrational directly from the continued fraction expression. $\endgroup$
    – Gareth Ma
    May 1, 2020 at 5:09
  • $\begingroup$ @GarethMa, this is VERY classical stuff (and so far it is very simple). $\endgroup$
    – Wlod AA
    May 1, 2020 at 5:18
  • 1
    $\begingroup$ Nevermind, I misread and misunderstood something, I see why it's irrational now :P $\endgroup$
    – Gareth Ma
    May 1, 2020 at 5:20

Here are my two cents. (Incomplete solution) The idea is to use the theory of convergents. Given a continued fraction with the representation $[a_0;a_1,a_2,...]$, one may write a series of rational approximations to the truncated continued fraction $$\dfrac{p_n}{q_n}:=a_0 + \dfrac{1}{a_1 + \dfrac{1}{a_2 + \dfrac{1}{... + \dfrac{1}{a_n}}}}$$ which are given by the recursive relation $A_n = a_nA_{n-1} + A_{n-2}$, valid for $n\ge -1$, where the initial conditions are $p_0 = a_0,p_{-1} = 1$, and $q_0 = 1, q_{-1} = 0$. Substituting $a_n = n^2$ for your continued fraction, it seems that we are looking at the recursive relation, for example for the numerators, given by $$p_{n} = n^2p_{n-1} + p_{n-2}.$$ Your question reduces to the question of finding a closed form for this discrete ordinary differential equation. I would suggest checking out Lukas' theorem which holds for relations of the form $a_n = \alpha a_{n-1} + \beta a_{n-2}$ such as the Fibonacci sequence for example and many others.

The idea is then that since the set of solutions to the equation $$A_{n} = n^2A_{n-1} + A_{n-2}$$ form a two dimensional vector space, by applying the initial conditions of $p$ and $q$ you can construct a closed form for the two. Typically, you would have one solution decaying and one going to infinity. Then if you found $$p_n = \alpha D(n) + \beta E(n),\quad q_n = \gamma D(n) + \delta E(n)$$ where $D(n)$ is the decaying function, then your continued fraction would be precisely equal to $$\dfrac{\beta}{\delta}.$$ As I said, this is incomplete as the question is what are the solutions to the recursive relations $A_n = n^2A_{n-1} + A_{n-2}$. Comparing with Lucas' Theorem, to solve this equation, you would essentialy want to know how to solve the following ODE $$f(x) = x^2f'(x) + f''(x).$$ All I can tell you is that it is a Strum-Liouville equation and maybe some analyst can pick up the ball from here :)

  • $\begingroup$ Unfortunately, $n= \infty$ is an irregular point for the recurrence in A, and so the approximation with the ODE might not work $\endgroup$
    – G Cab
    May 7, 2020 at 21:39

You must log in to answer this question.

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