# Continued Fraction using all Perfect Squares

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?

• It's 1.2432884784... Apr 18, 2020 at 23:22
• 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. May 1, 2020 at 15:09
• But without fancy constants or too much force, I'd say it's approximate to $\dfrac{5\times 7^{3/4}}{12\sqrt {3}}$ May 1, 2020 at 15:24
• 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. May 7, 2020 at 15:02
• 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. May 7, 2020 at 20:20

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{ %}$$

• 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. Apr 30, 2020 at 22:26
• Also just wondering, can you ask your friend how he got that crazy expression? Very curious May 1, 2020 at 1:28
• 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 ! May 1, 2020 at 1:47
• @ClaudeLeibovici: Would that former PhD student be Robert Munafo ? May 11, 2021 at 11:52
• @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 :-) 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)

1.24328847839971564408249654539442949923120026119744688506649745988163032233825342145964981561218559538890467348297701381456087507250067681969369422287394481106823198525320924225098067697793784504053388839947325461765969991600416411663928784095005020600017176700932548190583234985348139858549897037249626487595101212224593274130148983922702655057821224816791808680516525373955799210324551761696924319169880868859867394373255507204036873905460245016380602140886971188932788792004534073572611777381862869537164754562257622055586200098962299400115788330686330366349692355506114874528531989148443788939713051110708718763499836700885424205347399404711205719025462322085656886062558109392836051726411871492635286791717082160974321477110902114255736671637367782211494704866808671214003103134264294526344163295510488028137066937962453903624712552782295199344460880013595284144054791164042024679560460069025003399104291075994866032492192680289402243801395246804366648572804594835036565027012956457848519024683621071759138854168892152936131601393045918225297361539050001254865220428685955018761302830097810409603105996267899586104453972012058998671779368289467285453550404957934466484420769438142316194311386546598316496579775081672073060062318502089135148552587389753909412229458433174767777975925507523398094199059397469890781801547075171199998106106018355690780407908234632985702846260738629497384291103636574665555025023044984923355982351253355767746319065904960149568635879463751398856235096803786299543409250013752226144096131959751997496961228513717287891950784266647143422837734191074225842373022792510603871652815370739861465958025081223972785667964221993904920774239800993089897415640045030651976293653978596239688796189356672841973461944224406222485237165933685215338328246965418663851771767016025733608304176229645795762169519518056131950947030623723715156671237757513236314813017765174652854414804459704778983840308236355458482186039701182366583821977275491568743188372032199686289186216846315221546449368928376288608392780822632928349666946023568458883521622471041331229744203333882400906017526808516258953901332656517503602022730289807020281449038190152461911466702688210790580820975642935599011794660455601260001262488904353784063224341997860484130953573461410423517702408264933194376007832029308421380987597133575841852513196469960405614112003845760361969054582688353236843506390988117926540512066533351583073802283028922608906654448662449054997495347325027233999796401254085959204252720843767920207799104869887641909309802874614799948020274500537148542809194708801514801275650396803610116643354860881194033219324043392559634749415341929458682483500024988236829244667869008730885020992781539100350964753606860542286406244822674909909096511713924803554889972628771512229241001266367571171782942501244731950206365757564271293930077461317892638806872857794787118618101894534315239368762309917444762674814034408808667064272939683133604067971556663209543191412897044483453793704784086966014311811427984571183731582044500653171023965354166173726605999750410259987178221411565219833571583646012434645410877998831097126426133022455440361397221606803160676840154875764713859289978683334924874812719239333459437327106481196547663762181322316890734498257255023063639045876242543382646774397248740883774622532481200089909953414322445317902407816185139510058816237228001451320678273320698929989619182317548214164841576919852284035002961368185099285222958366993365832170685992893264181846279722383519726362574882868847034823224829315592178714910265667288543693631300523569063128272379356587365322352703148911926725468239164802277365567194880593573754388524351582684345789895422232160786171441187363773334905390848403047587481578926134511772814005757130528683677651081667676932627827576617665022573874410745390880341108662804221361905655381031435163999823001657833327755210242936743621991472569045947564685591887622152883580360992431656812762677475894659540787689593277383518139895014434797569451537179920009707930708746075282453855994960954232820746522097507969820638141164117432428361090940429960665544051821446205554704164805241254378653682652254723855019850569931182778028110911895537501575145896862244139982948494435308482949491662745002005196944018205353794354017083085996488785569081915969582357820907666013388692800978962140796220310895633540740286312820178552956015336845371534604133185162559333014055080974211851967198670088950269832159882829258495227547916502961548819794467361143655606143125526916063299389171634645316974758731525019287

Time to think of the math :D

• It is useful ! (+1) May 1, 2020 at 1:26
• lol thank you :D (Sage is op) 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 :) ).

• 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. May 1, 2020 at 5:09
• @GarethMa, this is VERY classical stuff (and so far it is very simple). May 1, 2020 at 5:18
• Nevermind, I misread and misunderstood something, I see why it's irrational now :P 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 :)

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