File:Partial sums riemann zeta function.svg
Summary
| Description |
English: The 30 first partial sums of Riemann's zeta function, for s = 1 and 2 (real numbers). This corresponds to the harmonic series, and the series introduced in the Basel problem. |
| Date | |
| Source | Own work |
| Author | Åshild Telle |
| Other versions | File:Partial sums riemann zeta function-no.svg, File:Partial sums riemann zeta function.png, File:Partial sums riemann zeta function-no.png |
| SVG development | |
| Source code | Python codeimport numpy as np
import matplotlib.pyplot as plt
def riemann_zeta_fn(n : int, s : complex) -> np.ndarray:
"""
Args_
n - number of points to plot
s - exponential
Returns:
numpy array of length n; values for the first n
terms in the series defining the riemann zeta function
"""
n_values = np.arange(1, n+1)
sequence_values = np.array([1/(n**s) for n in n_values])
return n_values, np.cumsum(sequence_values)
n = 30
n_values, riemann1 = riemann_zeta_fn(n, 1)
n_values, riemann2 = riemann_zeta_fn(n, 2)
label1 = r"$\sum_{n = 1}^{\infty} \frac{1}{n}$"
label2 = r"$\sum_{n = 1}^{\infty} \frac{1}{n^2}$"
plt.plot(n_values, riemann1, '*', label=label1)
plt.plot(n_values, riemann2, 'xb', label=label2)
plt.xlabel("n")
plt.ylabel("Partial sums")
plt.legend(fontsize=15)
plt.savefig("riemann_zeta_s1and2.svg")
|
Licensing
I, the copyright holder of this work, hereby publish it under the following license:
| This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication. | |
| The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.
|