Glaisher-Kinkelin Constant Digits

Author

Eric W. Weisstein
March 3, 2016

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

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

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

Computation

N[Glaisher,20]

Digits

(10^3)

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

cons=N[Glaisher,10^3+10];//Timing

DumpSave["/Developer/eww/Constants/Glaisher_10_3.mx",cons];

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

(10^4)

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

cons=N[Glaisher,10^4+10];//Timing

DumpSave["/Developer/eww/Constants/Glaisher_10_4.mx",cons];

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

(10^5)

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

cons=N[Glaisher,10^5+10];//Timing

DumpSave["/Developer/eww/Constants/Glaisher_10_5.mx",cons];

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

StringLength[string=StringTake[ToString[cons],{3,-3}]]//Timing

StringTake[string,10]

N[Glaisher]

DumpSave["/Developer/eww/DigitStrings/Glaisher_10_5.mx",string];

5×(10^5)

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

cons=N[Glaisher,5*^5+10];//Timing

1.269612307592`*^6/86400

DumpSave["/Developer/eww/Constants/Glaisher_5x10_5.mx",cons];

{ByteCount[cons]/10^6. MB,MaxMemoryUsed[]/10^9. GB}

StringLength[string=StringTake[ToString[cons],{3,-3}]]//Timing

StringTake[string,10]

N[Glaisher]

DumpSave["/Developer/eww/DigitStrings/Glaisher_5x10_5.mx",string];

(10^6)

Aborted after > 2 months after having first computed 5×(10^5) digits

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

cons=N[Glaisher,1*^6+10];//Timing

{ByteCount[cons]/10^6. MB,MaxMemoryUsed[]/10^9. GB}

DumpSave["/Developer/eww/Constants/Glaisher_10_6.mx",cons];

StringLength[string=StringTake[ToString[cons],{3,-3}]]//Timing

StringTake[string,10]

N[Glaisher]

DumpSave["/Developer/eww/DigitStrings/Glaisher_10_6.mx",string];

Read Constant

FileNames["/Developer/eww/Constants/Glaisher*"]

Get[%[[-1]]];//AbsoluteTiming

{N[cons],Precision[cons]}

Digit Distribution

MyStringPartition[s_String,chunksize_]:=Module[{len=StringLength[s],k},If[chunksize>len,{s},StringTake[s,#]&/@Table[{1+(k-1) chunksize,Min[len,k chunksize]},{k,Ceiling[len/chunksize]}]]]

BigStringCount[s_,c_,chunksize_:((2^31)-1)]:=Total[StringCount[#,c]&/@MyStringPartition[s,chunksize]]

(10^4)

(digits=Table[{n,BigStringCount[StringTake[string,10^n],#]&/@CharacterRange["0","9"]},{n,4}])//Timing

Grid[digits,Dividers->All,Alignment->Left]

A224615 to A224818

MapIndexed[{#2[[1]]-1,#}&,Transpose[digits[[All,2]]]]

(10^5)

(digits=Table[{n,BigStringCount[StringTake[string,10^n],#]&/@CharacterRange["0","9"]},{n,5}])//Timing

Grid[digits,Dividers->All,Alignment->Left]

AXXXXXX to AXXXXXX

MapIndexed[{#2[[1]]-1,#}&,Transpose[digits[[All,2]]]]

5×(10^5)

StringLength[string]

(digits=Table[{n,BigStringCount[StringTake[string,10^n],#]&/@CharacterRange["0","9"]},{n,5}])//Timing

Grid[digits,Dividers->All,Alignment->Left]

AXXXXXX to AXXXXXX

MapIndexed[{#2[[1]]-1,#}&,Transpose[digits[[All,2]]]]

Digit Runs

StringLength[string]

k n’s

(data=Flatten[Table[{d,n,If[#=={},0,First[#]]&/@StringPosition[string,StringJoin@@Table[ToString[d],{n}],10]},{d,0,9},{n,10}],1])//Timing

Grid[DeleteCases[data,{_,_,{}}],Dividers->All,Alignment->Left]

n n’s (Earls Sequence)

A224819

earls=Cases[DeleteCases[data,{_,_,{}}],{x_,x_,s_}:>{x,s[[1]]}]

earls[[All,2]]

Length[earls]

Scan until all n-digits strings have been found

?ScanDigitStrings

A000000/A000000

Length[realdigits=RealDigits[cons,10][[1]]]//Timing

Do[Print[{n,ScanDigitStrings[realdigits,n]//Timing}],{n,8}]

First digit string occurrences

A229193

Length[f=FirstDigitOccurrences[realdigits,6]]//Timing

Take[f,100]

Take[Position[f,0],10]//Flatten

<<Utilities`EISFormat`

BFile["~/b229193.txt",Take[f,10048],0]

Specific Digits Runs

StringLength[string]

0123456789

StringPosition[string,"0123456789"]//Timing

9876543210

StringPosition[string,"9876543210"]//Timing