Glaisher-Kinkelin Constant Continued Fraction

Author

Eric W. Weisstein
January 6, 2019

This notebook downloaded from http://mathworld.wolfram.com/notebooks/Constants/Glaisher-KinkelinConstantContinuedFraction.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/Glaisher-KinkelinConstantContinuedFraction.html.

©2019 Wolfram Research, Inc. except for portions noted otherwise

Terms

seq=ContinuedFraction[Glaisher,256]

FindSequenceFunction

FindSequenceFunction[Rest@seq,n]//Head//Timing

LinearRecurrence

FindLinearRecurrence[Rest[seq]]//Head//Timing

GeneratingFunction

(gf=FindGeneratingFunction[seq,x])//Head//Timing

Plots

ListPlot[Take[seq,100],Filling->Axis,PlotRange->All]

cf=ArrayPlot[Transpose@PadLeft@IntegerDigits[ContinuedFraction[Glaisher,256],2],PixelConstrained->3,Frame->False]

SetDirectory["/Users/eww/Sites/mathworld.wolfram.com/htdocs/images/gifs"];

Export["GlaisherKinkelinContinuedFractionBinaryPlot.gif",cf]

Compute

A099791

(10^3)

{Precision[a],Length[cf=ContinuedFraction[a]]}//Timing

HighWaterMarks[cf]

fo=FirstOccurrences[cf,200,Method->"LowMemory"]

Position[fo,0,1,1]

6×(10^3)

HighWaterMarks[cf]

(10^4)

HighWaterMarks[cf]

(10^5)

{Precision[a],Length[cf=ContinuedFraction[a]]}//Timing

(10^6)

{$MachineName,DateString[],$TopDirectory,$Version}//Column

Get["/Developer/eww/Constants/Glaisher_10_5.mx"];//Timing//AbsoluteTiming

{Precision[cons],N[cons],ByteCount[cons]/10^6. MB}

Length[cf=ContinuedFraction[cons]]//Timing

{ByteCount[cf],MaxMemoryUsed[]}/10^6.MB

DumpSave["/Developer/eww/ContinuedFractions/Glaisher_97059.mx",cf];

Read from .mx

Get["/Developer/eww/ContinuedFractions/Catalan_970278792.mx"];//Timing//AbsoluteTiming

{Length[cf],ByteCount[cf]/10^9. GB}

High Water Marks

A099791

A225752

Length[cf]

(10^5)

(hwm=HighWaterMarks[cf]);//Timing

Take[cf,20]

{hwm[[1]],hwm[[2]]-1}

First Occurrences

A196461

(10^6)

Length[cf]

fo=FirstOccurrences[cf];//Timing

p=Take[Position[fo,0],10]//Flatten

Take[fo,60]-1

BFile["~/b225762.txt",Take[fo,p[[1]]-1]-1]

ListPlot[Take[fo,p[[1]]-1]-1,AxesLabel->{Subscript[a,n],n},PlotRange->All]

Clear[fo]

n-Digit Terms

(10^6)

Length[cf]

digs=IntegerLength[cf];//Timing

Max[digs]//Timing

positions=Table[Flatten[Position[digs,n,1,20]],{n,6}];//Timing

data=MapIndexed[{#2[[1]],{#,cf[[#]]}}&,positions]

Grid[{#[[1]],Column@#[[2]]}&/@data,Dividers->All,Alignment->Left]

Khinchin and Lévy Constant

KhinchinList[x_,n_:200]:=MapIndexed[#1^(1/#2[[1]])&,Rest@FoldList[Times,1,Rest[ContinuedFraction[Mod[x,1],n+1]]]]
LevyList[x_,n_:200]:=MapIndexed[#1^(1/#2[[1]])&,Denominator/@FromContinuedFraction/@Reverse[NestList[Drop[#,-1]&,Rest[ContinuedFraction[Mod[x,1],n+1]],n]]]

<<Utilities`Typesetting`

With[{k=5000,c=Glaisher},
g1=ListPlot[KhinchinList[c,k],Joined->True,PlotStyle->Red,AxesLabel->{n,((Subscript[a, 1])(Subscript[⋯a, n]))^InlineFraction[1,n]},
PlotLabel->"Khinchin's constant",
Epilog->{Blue,Dashing[{.02}],Line[{{0,#},{k,#}}]&[2.685452001]}];
g2=ListPlot[LevyList[c,k],Joined->True,PlotStyle->Red,AxesLabel->{n,(Subscript[q, n])^InlineFraction[1,n]},
PlotLabel->"Lévy constant",
Epilog->{Blue,Dashing[{.02}],Line[{{0,#},{k,#}}]&[Exp[Pi^2/12/Log[2]]]}
];
];//Timing

GraphicsRow[{g1,g2},Spacings->-50,ImageSize->400]