Harmonic Series

Author

Eric W. Weisstein
June 5, 2008

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

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

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

Convergence

SumConvergence[1/n,n]

SumConvergence[1/Prime[n],n]

SumConvergence[(((((2/3)+(1/3)Sin[n]))^n)/n),n]//Timing

(unknown)

Plots of Reciprocals

<<Utilities`Plot`
<<Utilities`Typesetting`

Show[GraphicsArray[
Block[{$DisplayFunction=Identity},
Function[f,IntegerListPlot[Rest[FoldList[Plus,0,f/@Range[50]]],
AxesLabel->TraditionalForm/@{n,Sum[f[HoldForm[k]],{k,n}]}]]/@{1/#&,1/Prime[#]&,(-1)^(#-1)/#&}
]
],GraphicsSpacing->-.15]

Sum to Exceed n

Solve[HarmonicNumber[n]==k,n]

HarmonicIndex[k_,k0_:0,k1_:10^3,opts___]:=Module[{n},Ceiling[n/.FindRoot[HarmonicNumber[n]==k,{n,k0,k1},opts,WorkingPrecision->20]]]

(x=n/.FindRoot[HarmonicNumber[n]==1,{n,0,10^3},WorkingPrecision->10^3])//FullForm

Ceiling[x]

Note the special case of k==1

HarmonicIndex/@Range[100]

HarmonicIndex[10^#,100,10^20,WorkingPrecision->10^3,MaxIterations->500]&/@Range[3]

N[%]

Partitial Sums

(1/k)

Sum[1/k,{k,n}]

FindRoot[HarmonicNumber[n]==100,{n,10^10,10^20},WorkingPrecision->20]

HarmonicNumber[n]/.%

Oresme's Proof

Table[1/k,{n,0,3},{k,1+2^n,2^(n+1)}]

FullSimplify[Sum[1/k,{k,1+2^n,2^(n+1)}]]

Table[-HarmonicNumber[(2^n)]+HarmonicNumber[(2^(1+n))],{n,5}]

N[%]

1/(Subscript[p, k])

Sum[1/Prime[k],{k,n}]

Alternating Series

Sum[(-1)^(i+1)/i,{i,n}]

FullSimplify[%,n∈Integers]

Sum[(-1)^(i+1)/i,{i,Infinity}]

(∑_(n=1)^∞)((((((sin(n))/3)+(2/3)))^n)/n)

SumConvergence[(((((2/3)+(1/3)Sin[n]))^n)/n),n]//Timing

Sum[(((((2/3)+(1/3)Sin[n]))^n)/n),{n,∞}]//Timing

Plot[(((((2/3)+(1/3)Sin[n]))^n)/n),{n,1,50},PlotRange->All,PlotStyle->Red,AxesLabel->TraditionalForm/@{n,(((((2/3)+(1/3)Sin[n]))^n)/n)}]

Sum[(((((2/3)+(1/3)Sin[n]))^n)/n),{n,∞}]

Sum[(((((2/3)+(1/3)Sin[n]))^n)/n),{n,N}]

NSum[(((((2/3)+(1/3)Sin[n]))^n)/n),{n,∞}]

NSum[(((((2/3)+(1/3)Sin[n]))^n)/n),{n,∞},WorkingPrecision->20]//Timing

Sum[(((((2/3)+(1/3)Sin[n]))^n)/n),{n,10^4}]//N//Timing

Sum[(((((2/3)+(1/3)Sin[n]))^n)/n),{n,10^5}]//N//Timing

N[Plus@@Table[(((((2/3)+(1/3)Sin[n]))^n)/n),{n,10^5}],10]//Timing

Plus@@Table[(((((2/3)+((SetPrecision[1,20])/3)Sin[n]))^n)/n),{n,10^5}]//Timing

Plus@@Table[(((((2/3)+((SetPrecision[1,20])/3)Sin[n]))^n)/n),{n,10^6}]//Timing

Plus@@Table[(((((2/3)+((SetPrecision[1,20])/3)Sin[n]))^n)/n),{n,5 10^6}]//Timing

Plus@@Table[(((((2/3)+((SetPrecision[1,20])/3)Sin[n]))^n)/n),{n,10^7}]//Timing

s=Table[(((((2/3)+(1./3)Sin[n]))^n)/n),{n,10^5}];//Timing

ListPlot[MapIndexed[{#2[[1]],#1}&,
Take[Rest[FoldList[Plus,0,s]],{1,10^5,100}]
],PlotJoined->True,PlotStyle->Red]

ListPlot[MapIndexed[{Log[#2[[1]]],Log[#1]}&,
ListConvolve[Table[1,{1000}]/1000,s]
],PlotStyle->Red]

Fit[ListConvolve[Table[1,{1000}]/1000,s],{1,x},x]