aboutsummaryrefslogtreecommitdiffstats
path: root/buch/papers/zeta/python/primzahlfunktion.py
diff options
context:
space:
mode:
authorerik-loeffler <100943759+erik-loeffler@users.noreply.github.com>2022-08-15 09:54:10 +0200
committerGitHub <noreply@github.com>2022-08-15 09:54:10 +0200
commit504d47a5a03f60cd54425cfd97fbff750a3f9061 (patch)
tree74aef248a603bad26b825371af8526b008807950 /buch/papers/zeta/python/primzahlfunktion.py
parentMerge pull request #3 from haddoucher/sturmliouville/erik-branch (diff)
parentMerge pull request #49 from HeadAndToes/master (diff)
downloadSeminarSpezielleFunktionen-504d47a5a03f60cd54425cfd97fbff750a3f9061.tar.gz
SeminarSpezielleFunktionen-504d47a5a03f60cd54425cfd97fbff750a3f9061.zip
Merge branch 'AndreasFMueller:master' into master
Diffstat (limited to '')
-rw-r--r--buch/papers/zeta/python/primzahlfunktion.py24
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()
+