Golomb-Dickman Constant Digits

Author

Eric W. Weisstein
July 25, 2013

This notebook downloaded from http://mathworld.wolfram.com/notebooks/Constants/Golomb-DickmanConstantDigits.nb.

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

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

Initialization

Computation

Compare methods

NIntegrate[Exp[LogIntegral[x]],{x,0,1}]//Timing

NIntegrate[Exp[LogIntegral[x]],{x,0,1},WorkingPrecision->100,Method->"GaussKronrod"]//Timing

NIntegrate[Exp[LogIntegral[x]],{x,0,1},WorkingPrecision->100,Method->"DoubleExponential"]//Timing

Broadhurst

λBroadhurst=ToExpression["0."<>StringDrop[Import["http://physics.open.ac.uk/~dbroadhu/cert/p1659.in"][[2,1]],2]]

Precision[λBroadhurst]

λBroadhurst==λ1000

MathConstant

Precision[λ=MathConstant["GolombDickman"]]

λ==λBroadhurst

Precision[λ15000=Get["~/gd.m"]]

λ==λ15000

100

V6

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

NIntegrate[Exp[LogIntegral[x]],{x,0,1},WorkingPrecision->100,Method->DoubleExponential]//Timing

V7

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

NIntegrate[Exp[LogIntegral[x]],{x,0,1},WorkingPrecision->100,Method->"DoubleExponential"]//Timing

V8

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

NIntegrate[Exp[LogIntegral[x]],{x,0,1},WorkingPrecision->100,Method->"DoubleExponential"]//Timing

V9

{$MachineName,$Version,DateString[]}

NIntegrate[Exp[LogIntegral[x]],{x,0,1},WorkingPrecision->100,Method->"DoubleExponential"]//Timing

V10

{$MachineName,$Version,DateString[]}

NIntegrate[Exp[LogIntegral[x]],{x,0,1},WorkingPrecision->100,Method->"DoubleExponential"]//Timing

500

V6

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

NIntegrate[Exp[LogIntegral[x]],{x,0,1},WorkingPrecision->500,Method->DoubleExponential]//Timing

V7

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

NIntegrate[Exp[LogIntegral[x]],{x,0,1},WorkingPrecision->500,Method->"DoubleExponential"]//Timing

V8

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

NIntegrate[Exp[LogIntegral[x]],{x,0,1},WorkingPrecision->500,Method->"DoubleExponential"]//Timing

V9

{$MachineName,$Version,DateString[]}

NIntegrate[Exp[LogIntegral[x]],{x,0,1},WorkingPrecision->500,Method->"DoubleExponential"]//Timing

V10

{$MachineName,$Version,DateString[]}

NIntegrate[Exp[LogIntegral[x]],{x,0,1},WorkingPrecision->500,Method->"DoubleExponential"]//Timing

1000

V6

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

NIntegrate[Exp[LogIntegral[x]],{x,0,1},WorkingPrecision->1000,Method->DoubleExponential]//Timing

V7

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

NIntegrate[Exp[LogIntegral[x]],{x,0,1},WorkingPrecision->1000,Method->"DoubleExponential"]//Timing

V8

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

NIntegrate[Exp[LogIntegral[x]],{x,0,1},WorkingPrecision->1000,Method->"DoubleExponential"]//Timing

V9

{$MachineName,$Version,DateString[]}

NIntegrate[Exp[LogIntegral[x]],{x,0,1},WorkingPrecision->1000,Method->"DoubleExponential"]//Timing

V10

{$MachineName,$Version,DateString[]}

(λ1000=NIntegrate[Exp[LogIntegral[x]],{x,0,1},WorkingPrecision->1000,Method->"DoubleExponential"])//Timing

10,000

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

λ=NIntegrate[Exp[LogIntegral[x]],{x,0,1},WorkingPrecision->10000,Method->"DoubleExponential",MaxRecursion->15];//Timing

λ

15,000

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

λ=NIntegrate[Exp[LogIntegral[x]],{x,0,1},WorkingPrecision->15000,Method->"DoubleExponential",MaxRecursion->15];//Timing

cons=λ;

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

Put[cons,"~/gd.m"]

Timings

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

timings=Append[Table[{Print[n];n,First[Timing[NIntegrate[Exp[LogIntegral[x]],{x,0,1},WorkingPrecision->n,Method->"DoubleExponential"]]]},{n,{100,500,1000,2000}}],{10000,79362.87800799999968148767948150634765625`10.92021732192587}]

timings={{100,0.2859559999999999879705114835815038532`5.476899126732883},{500,5.67213800000000034629010770004242658615`6.774346701729217},{1000,37.32932499999999720330379204824566841125`7.5926500502344405},{2000,304.21775200000001859734766185283660888672`8.503784466095551},{10000,79362.87800799999968148767948150634765625`10.92021732192587},{15000,227834.44390}};

dataplot=ListLogLogPlot[timings]

FindFit[Log10[Drop[timings,2]],a+b x,{a,b},x]

timings[[All,1]]

fit=Table[{t,10^(-8.519+3.350Log10[t])},{t,{100,500,1000,2000,10000,15000}}]

fit[[-1,-1]]/86400.

10^(-8.519+3.350Log10[n])

fitplot=ListLogLogPlot[fit,Joined->True,PlotStyle->Green]

Show[{fitplot,dataplot}]

Digit Distribution

Precision[cons=MathConstant["GolombDickman"]]

N[cons]

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

StringTake[string,10]

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]]

15000

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

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

A224615 to A224818

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,12}],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]

Specific Digits Runs

StringLength[string]

0123456789

StringPosition[string,"0123456789"]//Timing

9876543210

StringPosition[string,"9876543210"]//Timing

Constant Primes

l=Reverse[FromDigits/@NestList[Most,IntegerDigits[digDJB],IntegerLength[digDJB]-1]];

Position[l,_?PrimeQ]//Flatten//Timing

l=Reverse[FromDigits/@NestList[Most,IntegerDigits[dig],IntegerLength[dig]-1]];

Position[l,_?PrimeQ]//Flatten//Timing

StringTake[ToString[digDJB],#]&/@{6,27}

Scan until all n-digits strings have been found

?ScanDigitStrings

A000000/A000000

Length[realdigits=RealDigits[MathConstant["GolombDickman"],10][[1]]]//Timing

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

First digit string occurrences

A229195

Length[realdigits]

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

Take[f,100]

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

<<Utilities`EISFormat`

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