diff options
author | Joshua Baer <joshua.baer@ost.ch> | 2022-08-16 10:28:39 +0200 |
---|---|---|
committer | Joshua Baer <joshua.baer@ost.ch> | 2022-08-16 10:28:39 +0200 |
commit | f3fc1867221ab08c20cbb3f21663e89a10526dcb (patch) | |
tree | 49ca3a3a863f57f2ea69025ed493ba6f35d12c36 /buch/papers/zeta/python/primzahlfunktion.py | |
parent | signal m draw (diff) | |
parent | fix a typo (diff) | |
download | SeminarSpezielleFunktionen-f3fc1867221ab08c20cbb3f21663e89a10526dcb.tar.gz SeminarSpezielleFunktionen-f3fc1867221ab08c20cbb3f21663e89a10526dcb.zip |
Merge branch 'master' of github.com:JODBaer/SeminarSpezielleFunktionen
Diffstat (limited to 'buch/papers/zeta/python/primzahlfunktion.py')
-rw-r--r-- | buch/papers/zeta/python/primzahlfunktion.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/buch/papers/zeta/python/primzahlfunktion.py b/buch/papers/zeta/python/primzahlfunktion.py new file mode 100644 index 0000000..9434de9 --- /dev/null +++ b/buch/papers/zeta/python/primzahlfunktion.py @@ -0,0 +1,24 @@ +import matplotlib.pyplot as plt +import numpy as np + +primzahlfunktion = [0, 0, 0, 0] +x = [0, 1-1e-12, 1, 2-1e-12] +x_last = 1 +value = 0 +for i in range(2, 30, 1): + new_value = value + 1 + for j in range(2, i, 1): + if i % j == 0: + new_value = value + value = new_value + primzahlfunktion.append(new_value) + x_last += 1 + x.append(x_last) + primzahlfunktion.append(new_value) + x.append(x_last + 1 - 1e-12) + + +plt.rcParams.update({"pgf.texsystem": "pdflatex"}) +plt.plot(x, primzahlfunktion) +plt.show() + |