For a real number , write
for its fractional part. Assuming the prime number theorem, we shall prove that
where is Euler’s constant. The quantities
fluctuate in a seemingly irregular way as
runs through the primes. The useful observation is that, after dividing by
, the primes up to
become uniformly distributed through
with respect to normalized prime counting measure. Since
the problem becomes one of averaging the fixed function over these scaled primes. The only issue is that
has infinitely many jumps accumulating at
. We first avoid that endpoint, and then show that the discarded interval makes a negligible contribution.
Indeed, for fixed , the prime number theorem gives
Thus the proportion of primes for which
tends to the length of that interval. By first proving the assertion for step functions and then approximating bounded Riemann-integrable functions by step functions, one obtains, for every fixed
and every bounded Riemann-integrable function
Apply this with On
, this function has only finitely many discontinuities, at the reciprocal integers lying in that interval, and so it is Riemann integrable. Therefore
The primes below do not affect the limit. Since
we have
and similarly
Letting , we obtain
It remains to evaluate the integral. For each integer , on the interval
one has
, and hence
Thus
The -th partial sum is
where
is the harmonic sum. Since
it follows that
Consequently,
The limiting average is not because the fractional parts
do not themselves become uniformly distributed. Rather, it is the scaled position
of the prime that becomes uniform. The nonlinear transformation
then turns this uniform distribution into one with mean