Soldner’s Constant Continued Fraction

Author

Eric W. Weisstein
October 7, 2013

This notebook downloaded from http://mathworld.wolfram.com/notebooks/Constants/SoldnersConstantContinuedFraction.nb.

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

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

Compute

SetDirectory["/Developer/eww"];

(10^4)

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

DumpSave["ContinuedFractions/Soldner_"<>ToString[Length[cf]]<>".mx",cf];

(10^5)

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

(10^6)

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

ByteCount[cf]

DumpSave["ContinuedFractions/Soldner_"<>ToString[Length[cf]]<>".mx",cf];

(10^7)

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

ByteCount[cf]

DumpSave["ContinuedFractions/Soldner_"<>ToString[Length[cf]]<>".mx",cf];

Read

FileNames["ContinuedFractions/Soldner*"]

Get[%[[-1]]];

HighWaterMarks

A099804/A229230

Length[cf]

Take[cf,10]

HighWaterMarks[cf,0]//Timing

Length[{1,2,4,47,99,294,527,616,1152,1456,2638,2705,4105,31772,88683,90658,95845,237245,1387437,5499408,12672729,110482114}]

First Occurrences

Length[cf]

Length[fo=FirstOccurrences[cf,0]]//Timing

Take[fo,100]

Length[p=Position[fo,-1]//Flatten]//Timing

Take[p,10]

<<Utilities`EISFormat`

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

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

n-Digit Terms

Length[cf]

ByteCount[cf]

digs=IntegerLength[cf];//Timing

(max=Max[digs])//Timing

positions=Table[Flatten[Position[digs,n,1,20]],{n,max}];//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=cons},
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]