von Staudt-Clausen Theorem

Author

Eric W. Weisstein
February 22, 2004

This notebook downloaded from http://mathworld.wolfram.com/notebooks/PrimeNumbers/vonStaudt-ClausenTheorem.nb.

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

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

Code

VonStaudtFraction[n_]:=Total[1/VonStaudtPrimes[n]]

VonStaudtPrimes[n_]:=Module[{},
Select[Prime[Range[PrimePi[2n]+1]],IntegerQ[2n/(#-1)]&]
]

Examples

n=1

BernoulliB[2]

VonStaudtPrimes[1]

1-(1/2+1/3)

n=6

BernoulliB[12]

VonStaudtPrimes[6]

1-Plus@@(1/VonStaudtPrimes[6])

Enumeration

Table[{i,VonStaudtFraction[i],BernoulliB[2i]+VonStaudtFraction[i]},
{i,20}]//ColumnForm

Table[VonStaudtPrimes[n],{n,5}]