This website is still under construction, so there are probably some errors. Corrections are welcome.
The Riemann zeta is most important function in number theory. The purpose of this interactive website is to illustrate the importance of its zeros to prime numbers.
In this interactive website, we will consider three functions that we collectively call prime counting functions. We will be looking at the prime counting function $\pi(x),$ and Chebyshev's $\theta(x),\psi(x)$ functions. Each of these functions functions are defined below. Each section contains at least one interactive plot; to run the interactive plot simply press the "Launch the Interactive Applet Now" button. The interactive plots are made from Sagemath.
First, we consider the prime counting function $\pi(x)$ which is the number of primes less than $x.$ For example, $\pi(4.5) = 2$ because the primes less than 4.5 are 2 and 3. Please run the applet below to see a graph of $\pi(x)$ in the range with minimum 0 and maximum $X.$ The slider called $X$ changes the maximum. To better see how $\pi(x)$ changes values at primes, there is an option to plot $\pi(x)$ at primes.This applet also can plot $x^{\alpha}$ for $\alpha = \{1/2,7/10,3/4,1\}.$ The goal of this is to see how $\pi(x)$ grows with $x.$
As one can see that for all values of intervals plotted $ \pi(x) \leq x.$ This is the consequence of the fact that not all integers are primes; moreover, one can see that for the other powers graphed eventually $\pi(x)$ overtook them. We will see why is this so later on.
Before defining the Chebyshev functions. We define a standard notation in analytic number theory: $$\sum_{n \leq X}f(n) = \sum_{n = 1}^{\lfloor X \rfloor}f(n) = f(1) + f(2) + \cdots + f(\lfloor X \rfloor),$$ where $\lfloor X \rfloor$ is the floor function(the greatest integer less than X). Furthermore, if we wan to just sum over primes; it is very common to write simply $$\sum_{p \leq X}f(p) = f(2) + f(3) + \cdots + f(p_{\pi(X)}),$$ where $p_{n}$ denotes the nth prime. For example, $\pi(x) = \sum_{p \leq x} 1.$ Using this, we define $\theta(x),$ $$\theta(x) = \sum_{p \leq x} \ln(p) = \ln(2) + \ln(3) +\cdots + \ln(p_{\pi(x)}).$$ For example, $\theta(6) = \ln(2) + \ln(3) + \ln(5) \approx 3.4.$ By this definition, $\theta(x)$ is the sum over primes weighted by $\ln(p).$ The next function we define is $\psi(x),$ to do so we let $$\Lambda(n)=\begin{cases}\ln(p) & \text{ if } n = p^k\\ 0 & \text{o.w.} \end{cases}.$$ Functions that are only non-zero on prime powers or one are normally said to be supported on prime powers; $\Lambda$ is one such example. Now, we define $$ \psi(x) = \sum_{n \leq x} \Lambda(n).$$ Taking $x > 7,$ we have $$\psi(x) = \sum_{n \leq x} \Lambda(n) = \Lambda(2) + \Lambda(3) + \Lambda(4) + \Lambda(5) + \Lambda(7) + \cdots = \ln(2) + \ln(3) + \ln(2) + \ln(5) +\ln(7) +\cdots.$$ Again, please run the applet below to see the graphs of $\theta(x),\psi(x),$ $x^\alpha.$ You can change the range and click to graph whichever function you like and to include the values of $\theta$ and $\psi$ at primes or prime powers.
As you can see in the graphs $\psi(x),\theta(x)$ seem to have size really close to $x.$ In turns out, this is the case.
The prime number theorem tells us the asymptotic behavior of $\pi(x),\theta(x),$ and $\psi(x).$ The prime number theorem in its simpliest form is $$ \lim_{x \to \infty} \frac{\pi(x)\ln(x)}{x} = \lim_{x\to \infty} \frac{\pi(x)}{\frac{x}{\ln(x)}} = 1,$$ this tells us that $\pi(x)$ grows like $\frac{x}{\ln(x)}.$ In fact, we actually have better approximation for $\pi(x),$ $$ \text{Li}(x) = \int_{2}^{x} \frac{dt}{\ln(t)}.$$ Note that this integral starts at 2. This is to avoid when $\ln(1) = 0.$ Please run the applet below to see the comparison. Simply click on which function you would like to plot. Again, the slider $X$ increases the max value for which the functions are plotted.
In fact the prime number theorem tells us that for any $0 \leq \alpha < 1$, $$ \lim_{x \to \infty} \frac{\pi(x)}{x^{\alpha}} = \lim_{x\to \infty} \frac{\frac{x}{\ln(x)}}{\frac{x}{\ln(x)}} \frac{\pi(x)}{x^{\alpha}} = \lim_{x \to \infty} \frac{\pi(x)\ln(x)}{x} \frac{x^{1-\alpha}}{\ln(x)} = \infty.$$ This limit diverges because $\lim_{x \to \infty} \frac{\pi(x)\ln(x)}{x} = 1$ and $\lim_{x \to \infty}\frac{x^{1-\alpha}}{\ln(x)} = \infty$ by L'Hôpital's rule. This tells us that $\pi(x)$ is eventually larger than any $x^{\alpha}$ for any $\alpha \in [0,1).$ It turns out that the prime number theorem tells us the asymptotic behavior of $\theta,$ and $\psi$ as well because the following are equivalent \begin{align} & \lim_{x\to \infty} \frac{\pi(x)\ln(x)}{x} = 1\\ & \lim_{x\to \infty} \frac{\theta(x)}{x} = 1 \\ & \lim_{x \to \infty} \frac{\psi(x)}{x} = 1. \end{align} This tells us that if $\pi(x)$ grows like $\frac{x}{\ln(x)}$ then $\theta(x)$ and $\psi(x)$ grow like $x$ and vice-versa.
The Riemann zeta function is defined in the following way, $$ \zeta(s) = \sum_{n =1}^{\infty} \frac{1}{n^s}, $$ where we take $s$ to be a real number greater than 1, which by the integral test we have this sum converges: $\int_{1}^{\infty} x^{s}dx = \frac{1}{1+s}x^{s+1}|_{1}^{\infty} = \frac{1}{1+s},$ if $s>1.$ On the otherhand, when $s=1$ we have $$\zeta(s) = \sum_{n =1}^{\infty} \frac{1}{n},$$ but this diverges by the integral test $(\int_{1}^{x}\frac{dx}{x} = \ln(x)).$ Therefore, we can only define $\zeta(s)$ as the sum above when $s >1.$ Despite this barrier, we can still define $\zeta(s)$ for $s >0.$ It turns out that for $s>1,$ $$\zeta(s) = \sum_{n = 1}^{\infty}\frac{1}{n^s} = \frac{s}{s-1} -s \int_{1}^{\infty}(x - \lfloor x\rfloor)x^{-s-1}dx.$$ This gives another defintion of the $\zeta$ function. The left hand side of the equation above can be understood for $s \in (0,\infty).$ This is an example of what is called analytic continuation. Here is a graph of $\zeta(s)$ for $s$ in various ranges
As you can see in the graph there is a vertical asymptote at $s = 1.$ In analytic number theory, we call this point a pole. It turns out this pole plays an essential role in applications of the Riemann zeta to arithmetic functions. This will be discussed in the section on explicit formulas below. The last thing, I would like to talk about the behavoir of $\zeta$ in the second range. It seems that $\zeta(s)\to 1$ as $s \to \infty,$ which is actually true. It turns out the way we should be thinking about this function as a funciton of complex variable. This is a function $f$ that takes in a complex number $x+iy$ and returns a complex number. One way of thinking about is the following $$f(x+iy) = u(x,y) +iv(x,y),$$ where $u(x,y)$ and $v(x,y)$ are function of two real variables like in Calculus 3. In particular, you can think of $f$ as function from $\mathbb{R}^2 \to \mathbb{R}^2.$ Here, is a heat map of $\zeta(s).$ You can increase up to which height $\zeta$ is plotted. This graph can be also seen on Sagemath's page on Complex Plots.
In the above graph, on the line with real part $\frac{1}{2}$ the $\zeta(s)$ seems to be acting strangely. It turns out this behavior corresponds to the zeros of $\zeta(s).$ In his memior in 1860, Riemann conjectured that all the zeros with real part in $[0,1]$ lie on this line. This is still unknown to this day. We have calculated at least 103,800,788,359 zeros in this region, and every single one of them have real part $\frac{1}{2}.$ For example, we have the first zero being at around $\frac{1}{2} + 14.1347251417i,$ which can be seen in the graph above. To see more values of the zeros see the L-functions Modular Forms Database's webpage on this. In fact, this is one of the most coveted open conjecture in mathematics. So much so, that it is one of the Millenium problems from the Clay Institute. The zeros of $\zeta$ have a myraid of applications althougout number theory, but the most classical one is to prime numbers which is the focus of this page, and its final section.
Due to complex analysis, we have the astounding connection between the zeros of the $\zeta$ and the prime counting functions described above. We highlight the connection with the $\psi.$ Although, we do not know whether all the zeros of $\zeta$ have real part $\frac{1}{2},$ we do know there are infinitely many of them. Let $z_n = x_n +iy_n$ be the nth zero of $\zeta.$ With this, we have for $x >1,$ $$ \psi(x) = \begin{cases} \displaystyle x + \frac{1}{2}\ln(x)- \sum_{n=1}^{\infty} \frac{x^{z_n}}{z_n} - \ln(2 \pi) - \frac{1}{2}\ln(1-x^{-2})& \text{ if } x = p^k \\ \displaystyle x - \sum_{n=1}^{\infty} \frac{x^{z_n}}{z_n} -\ln(2 \pi) - \frac{1}{2}\ln(1-x^{-2})& \text{ o.w.} \end{cases} $$ As mentioned earlier, the pole at $s=1$ plays a major role in the formula above; namely it is where the $x$ term above arrives. Additionally, using this formula, we can approximate the $\psi$ function using the zeros of $\zeta.$ We define our approximation of the $\psi$ function as $$\tilde{\psi}(x,N) = \begin{cases} \displaystyle x + \frac{1}{2}\ln(x)- \sum_{n=1}^{N} \frac{x^{z_n}}{z_n} - \ln(2 \pi) - \frac{1}{2}\ln(1-x^{-2})& \text{ if } x = p^k \\ \displaystyle x - \sum_{n=1}^{N} \frac{x^{z_n}}{z_n} -\ln(2 \pi) - \frac{1}{2}\ln(1-x^{-2})& \text{ o.w.} \end{cases}.$$ In the applet below, you can compare $\psi(x)$ and $\tilde{\psi}(x)$ in various ranges. Moreover, you can change the number of zeros in the sum for $\tilde{\psi(x)}.$ Finally, you chose to plot the points $(p^k,\psi(p^k))$ by clicking the prime powers button.
In the graph, if you fix the number of zeros and change the range to have large x, the approximation becomes less accurate. On the other hand, if you fix the range and increase the number of zeros the approximation becomes better. This is similiar to increasing the number of terms in a fourier series.
Thank you for working through these interactive examples. I hope you enjoyed working through this examples. If you are interested in learning more, I suggest reading Tom M. Apostol's wonderful introductory book on the subject: Introduction to Analytic Number Theory. I would also like to thank the NSF for my graduate research fellowship.