Skip to content

selvinsource/study-distribution-primes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

A study of the distribution of primes using R

This repository is a collection of R scripts that visually represent some of the concepts exposed in Derbyshire, J. (2004) using a numerical analysis approach.

Derbyshire, J. (2004) main objective is to show the connection between the distribution of primes and the zeros of the zeta function: this is the main result of Riemann's 1859 paper "On the number of primes less than a given Quantity" that also contains the unsolved Riemann Hypothesis.

Series

A series is the sum of the terms of a sequence of numbers. The series is convergent if approaches a given number, otherwise divergent.
An example of convergent series is



R code

The harmonic series diverges



R code

Functions

A function is a relation between an input and a single output according to some rule.
Example of functions:

  • a function whose rule is to count the number of factors for a given argument (referred also as d(N))
  • a function whose rule is to count the number of prime factors for a given argument


R code

The Prime Counting Function

The Prime Counting Function π(N), the central study of the Riemann's 1859 paper, is defined to be the number of primes up to N


R code

The Prime Number Theorem (PNT) states



R code

The log function is close to N/π(N) and the error (the red line) gets smaller the larger is N.

The log integral function Li(x) is defined as



R code

The PNT (improved version) states



R code

The log integral function is a much better estimate than N/logN.

Von Koch's 1901 result



R code

That is π(x)-Li(x) is big oh of sqrt(x)\*logx, meaning π(x)-Li(x) never exceeds some fixed multiple of sqrt(x)\*logx. The result is valid if the Riemann Hypothesis is true (stated in the Riemann's Zeta Function section below).

Prime Counting step Function for real number π(x)


R code

defined as the number of primes up to the real number x.

Riemann defined another step function in terms of π(x)



R code

Inverting the above relationship

Riemann's Zeta Function

The Basel series converges (each term is the square of the corresponding term in the harmonic series which diverges)



R code

This is Euler's solution of the Basel problem which also gave a closed form for all even number. For odd numbers there is no closed form.

The Riemann zeta function



R code

When s = 1, the zeta function is the harmonic series and it has no value (inf). When s = 2, the zeta function is the Basel series and the value is π^2/6.

The series describes only part of the zeta function (s > 1).
Zeta function extended domain using





R code

The zeta function is zero when s is a negative even number. These are the trivial zeros.

Extending the domain to complex numbers,
the Riemann Hypothesis states that all non-trivial zeros of the zeta function have real part one-half.
In other words, the zeros are complex numbers of type 1/2+Ti, thus all lying on the critical line Re(s) = 1/2.

Value complex plane, showing points coming from the critical line


R code

Number of zeros up to the height T (imaginary part of complex number)



R code

Zeta function using Möbius function



R code

As important as the Möbius function is its cumulative value called Mertens's function, for which



R code

The above is equivalent to Denjoy's Probabilistic Interpretation of the Riemann Hypothesis: a square-free number has either an even or odd number of prime factors with a 50-50 probability, [Edwards, H. M. (2001)], pp 268-269.

Riemann's 1859 paper main result

Euler product formula



R code

On the left hand a sum including all positive whole numbers (the zeta function), on the right hand a product including all prime numbers.

Riemann, in his 1859 paper, rewrote the above formula in calculus version



R code

By inverting the expression above



R code

This represent the main result of Riemann's 1859 paper.

To summarize, π(x) can be expressed in terms of J(x)

J(x) in terms of zeta function

therefore π(x) can be expressed in terms of zeta function.

That is the distribution of primes π(x) depends on the non-trivial zero's of the zeta function.

Since the Riemann Hypothesis is a statement on these zeros, if it is true, some properties follow on the distribution of primes.
However if the Riemann Hypothesis is false, Riemann's main result is still valid, in fact it was proved by von Mangoldt in 1895.

References

About

A study of the distribution of primes using R

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages