Kempner Series

Author

Eric W. Weisstein
June 15, 2004

This notebook downloaded from http://mathworld.wolfram.com/notebooks/Calculus/KempnerSeries.nb.

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

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

Code

Kempner[d_,n_]:=Sum[KroneckerDelta[DigitCount[k,10,d]]/k,{k,n}]

Kempner[d_,n_]:=Sum[(1-Sign[DigitCount[k,10,d]])/k,{k,n}]

Kempner[d_,n_]:=Sum[(1-Unitize[DigitCount[k,10,d]])/k,{k,n}]

Kempner[h_,d_]:=Total[1./Select[h,FreeQ[IntegerDigits[#],d]&]]

Example

(Subscript[K, 1])

Plus@@HoldForm/@(1/Select[Range[30],FreeQ[IntegerDigits[#],1]&])

Total[HoldForm/@DeleteCases[Table[KroneckerDelta[DigitCount[k,10,1]]/k,{k,30}],0]]

Total[HoldForm/@DeleteCases[Table[(1-Unitize[DigitCount[k,10,1]])/k,{k,30}],0]]

Lower Bounds

h=Range[10^6];//Timing

Do[Print[{d,Kempner[h,d]//Timing}],
{d,0,9}]

l={23.10344,16.17696,19.25735,20.56987,21.32746,21.83460,22.20559,22.49347,22.72636,22.92067};

SequenceLimit[FoldList[Plus,0,1./Select[h,FreeQ[IntegerDigits[#],0]&]]]//Timing

Others

Complement[Range[10000],Select[Range[10000],!StringMatchQ[ToString[#],RegularExpression[".*314.*"]]&]]

l=1./Select[Range[10^6],!StringMatchQ[ToString[#],RegularExpression[".*314.*"]]&];//Timing

Total[l]

SequenceLimit[Accumulate[l]]

Not even close: correct is

2288.82978

ListPlot[Accumulate[l][[1;;-1;;10^3]]]