Apéry’s Constant Digits

Author

Eric W. Weisstein
September 17, 2013

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

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

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

Computation

SetDirectory["/Developer/eww"];

Constant Compute

N[Zeta[3],20]

(10^5)

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

Precision[cons=N[Zeta[3],1*^5+10]]//Timing

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

(10^6)

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

Precision[cons=N[Zeta[3],1*^6+10]]//Timing

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

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

(10^7)

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

Precision[cons=N[Zeta[3],1*^7+10]]//Timing

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

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

(10^8)

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

Precision[cons=N[Zeta[3],1*^8+10]]//Timing

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

DumpSave["Constants/Zeta3_10_8.mx",cons];

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

DumpSave["DigitStrings/Zeta3_10_8.mx",string];

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

DumpSave["RealDigits/Zeta3_10_8.mx",realdigits];

(10^9)

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

Precision[cons=N[Zeta[3],1*^9+10]]//Timing

N[cons]

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

DumpSave["Constants/Zeta3_10_9.mx",cons];

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

DumpSave["DigitStrings/Zeta3_10_9.mx",string];

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

DumpSave["RealDigits/Zeta3_10_9.mx",realdigits];

Read RealDigits

FileNames["RealDigits/Zeta3*"]

Get[%[[-1]]];

Digit Distribution

StringLength[string]

StringPartition[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]&/@StringPartition[s,chunksize]]

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

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

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

Digit Runs

k n’s

StringLength[string]

(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)

A229074

StringLength[string]

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

A036906/A036902

Length[realdigits]

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

First digit string occurrences

A229187

Length[realdigits]

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

Take[f,100]

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

<<Utilities`EISFormat`

BFile["~/b229187.txt",Take[f,1000],0]

Specific Digits Runs

StringLength[string]

0123456789

StringPosition[string,"0123456789"][[All,1]]//Timing

9876543210

StringPosition[string,"9876543210"][[All,1]]//Timing