<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
	<id>https://wiki-de.moshellshocker.dns64.de/index.php?action=history&amp;feed=atom&amp;title=Primzahlgenerator</id>
	<title>Primzahlgenerator - Versionsgeschichte</title>
	<link rel="self" type="application/atom+xml" href="https://wiki-de.moshellshocker.dns64.de/index.php?action=history&amp;feed=atom&amp;title=Primzahlgenerator"/>
	<link rel="alternate" type="text/html" href="https://wiki-de.moshellshocker.dns64.de/index.php?title=Primzahlgenerator&amp;action=history"/>
	<updated>2026-05-31T18:43:00Z</updated>
	<subtitle>Versionsgeschichte dieser Seite in Wikipedia (Deutsch) – Lokale Kopie</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://wiki-de.moshellshocker.dns64.de/index.php?title=Primzahlgenerator&amp;diff=574790&amp;oldid=prev</id>
		<title>~2025-47925-7 am 29. August 2025 um 03:52 Uhr</title>
		<link rel="alternate" type="text/html" href="https://wiki-de.moshellshocker.dns64.de/index.php?title=Primzahlgenerator&amp;diff=574790&amp;oldid=prev"/>
		<updated>2025-08-29T03:52:37Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Neue Seite&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Als &amp;#039;&amp;#039;&amp;#039;Primzahlgenerator&amp;#039;&amp;#039;&amp;#039; bezeichnet man in der [[Informatik]] einen [[Algorithmus]] &amp;lt;math&amp;gt;f(n)&amp;lt;/math&amp;gt;, so dass für [[natürliche Zahl]]en &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; der Wert &amp;lt;math&amp;gt;f(n)&amp;lt;/math&amp;gt; die &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;-te [[Primzahl]] ist. In der [[Mathematik]] und speziell der [[Zahlentheorie]] entspricht das Formeln, die besonders viele Primzahlen liefern &amp;#039;&amp;#039;&amp;#039;(Formeln für Primzahlen).&amp;#039;&amp;#039;&amp;#039; Bisher wurde noch kein [[Effizienz (Informatik)|effizienter]] Primzahlgenerator gefunden, insbesondere existiert keine praktikable geschlossene Formel zur Generierung von Primzahlen.&lt;br /&gt;
&lt;br /&gt;
Es gibt allerdings Formeln, bei denen eine gewisse Wahrscheinlichkeit besteht, dass eine erzeugte Zahl eine Primzahl ist, so dass die erzeugten Zahlen noch darauf getestet werden müssen, ob sie prim sind. Im Artikel werden auch andere Formeln behandelt, die nicht praxistauglich sind, die aber in der mathematischen Literatur bezüglich der Frage diskutiert wurden, ob sie viele Primzahlen liefern.&lt;br /&gt;
&lt;br /&gt;
== Geschichte ==&lt;br /&gt;
&lt;br /&gt;
Einer der ältesten Algorithmen zur Bestimmung von Primzahlen ist das [[Sieb des Eratosthenes]], bei dem nacheinander aus einer Liste der natürlichen Zahlen diejenigen Zahlen gestrichen werden, die Vielfache der jeweils kleinsten noch nicht gestrichenen Zahl sind. Dadurch bleiben die Primzahlen innerhalb der Ausgangsliste übrig.&lt;br /&gt;
&lt;br /&gt;
Schon [[Leonhard Euler|Euler]] gab die Formeln &amp;lt;math&amp;gt;n^2+n+17&amp;lt;/math&amp;gt; und &amp;lt;math&amp;gt;n^2-n+41&amp;lt;/math&amp;gt; an, die für &amp;lt;math&amp;gt;0 \leq n &amp;lt; 16&amp;lt;/math&amp;gt; bzw. &amp;lt;math&amp;gt;0 \leq n &amp;lt; 41&amp;lt;/math&amp;gt; Primzahlen liefern. Auch für größere Werte von &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; liefern die beiden Formeln viele [[Primzahl]]en, weil das Ergebnis nie durch Primzahlen &amp;lt;math&amp;gt;p &amp;lt; 17&amp;lt;/math&amp;gt; bzw. &amp;lt;math&amp;gt;p &amp;lt; 41&amp;lt;/math&amp;gt; ganzzahlig teilbar ist. Allgemein gibt es viele solche Formeln &amp;lt;math&amp;gt;an^2+bn+c&amp;lt;/math&amp;gt;, wodurch sich die auffällige [[Ulam-Spirale]] erklärt. Man kann [[Quadratisches Polynom|quadratische]] [[Irreduzibles Polynom|irreduzible Polynome]] mittels eines Siebalgorithmus als Primzahlgenerator verwenden.&amp;lt;ref&amp;gt;{{Internetquelle |autor=Helmes, Bernhard |url=https://www.devalco.de/poly_sec.php |titel=Prime generators on quadratic irreducible polynomials |sprache=Englisch |abruf=2016-10-06}}&amp;lt;/ref&amp;gt; Jedes [[Polynom]] liefert die Hälfte der Primzahlen. Dafür werden folgende quadratischen Polynome: verwendet: &amp;lt;math&amp;gt;4n^2+1&amp;lt;/math&amp;gt; (Primzahlen [[Kongruenz (Zahlentheorie)|kongruent]] 1 [[modulo]] 4), &amp;lt;math&amp;gt;2n^2+1&amp;lt;/math&amp;gt; (Primzahlen kongruent 1 oder 3 modulo 8) und &amp;lt;math&amp;gt;2n^2-1&amp;lt;/math&amp;gt; (Primzahlen 1 oder 7 modulo 8) Mittels dieser quadratischen Polynome werden alle Primzahlen als [[Teilbarkeit|Teiler]] der Polynome generiert.&amp;lt;ref&amp;gt;{{Internetquelle |autor=Helmes, Bernhard |url=https://www.devalco.de/#106 |titel=Primzahlgenerierende quadratische irreducible Polynome |datum=2020 |sprache=englisch |abruf=2025-05-05}}&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;{{Internetquelle |autor=Helmes. Bernhard |url=https://www.devalco.de/quadr_Sieb_2x%5E2+1.php#5 |titel=Prime sieving for the polynomial f(n)=2n2+1 |abruf=2025-05-05}}&amp;lt;/ref&amp;gt; Es gibt aber nach [[Adrien-Marie Legendre]] kein Polynom, das für alle oder [[fast alle]] Werte der Variablen in den [[Natürliche Zahl|natürlichen Zahlen]] Primzahlen ergibt. Die Frage, welche ganzzahligen Polynome unendlich viele Primzahlen erzeugen, ist Gegenstand der [[Bunjakowski-Vermutung]].&lt;br /&gt;
&lt;br /&gt;
Die beliebteste ist die der [[Mersenne-Primzahl|Mersenne-Zahl]] &amp;lt;math&amp;gt;M_n = 2^n-1&amp;lt;/math&amp;gt;, bei der &amp;lt;math&amp;gt;M_n&amp;lt;/math&amp;gt; eine Primzahl ist. Durch die besonderen Eigenschaften der Teiler von Mersenne-Zahlen eignen sie sich für die Suche nach möglichst großen Primzahlen.&lt;br /&gt;
&lt;br /&gt;
[[Pierre de Fermat|Fermat]] vermutete, dass alle Zahlen der Form &amp;lt;math&amp;gt;2^{2^n}+1&amp;lt;/math&amp;gt; prim sind; man nennt sie [[Fermat-Zahl]]en. Tatsächlich ist aber für &amp;lt;math&amp;gt;n&amp;gt;4&amp;lt;/math&amp;gt; keine derartige Primzahl bekannt.&lt;br /&gt;
&lt;br /&gt;
Auch bekannt ist eine Anwendung des Satzes von [[Euklid]], bei der zum [[Primorial]] &amp;lt;math&amp;gt;p\#&amp;lt;/math&amp;gt; (Produkt aller Primzahlen von 2 bis &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt;) eine 1 addiert wird:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;math&amp;gt;p\# + 1 = 2 \cdot 3 \cdot 5 \dotsm p + 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;p\# + 1&amp;lt;/math&amp;gt; ist prim für &amp;lt;math&amp;gt;p = 2, 3, 5, 7, 11, 31, 379, 1019, 1021, \dotsc&amp;lt;/math&amp;gt; ({{OEIS|A005234}}) Es ist unbekannt, ob es unendlich viele Primzahlen gibt, die so erzeugt werden.&lt;br /&gt;
&lt;br /&gt;
=== Primzahlerzeugende quadratische Polynome ===&lt;br /&gt;
&lt;br /&gt;
Ein &amp;#039;&amp;#039;primzahlerzeugendes Polynom&amp;#039;&amp;#039; ist ein [[quadratisches Polynom]] mit der Gleichung &amp;lt;math&amp;gt;f(x)=ax^2+bx+c&amp;lt;/math&amp;gt; mit &amp;lt;math&amp;gt;a \ge 1&amp;lt;/math&amp;gt; und &amp;lt;math&amp;gt;c \ge 1&amp;lt;/math&amp;gt; und der Eigenschaft, dass es ein &amp;lt;math&amp;gt;d&amp;gt;2&amp;lt;/math&amp;gt; gibt, für das &amp;lt;math&amp;gt;f(0), f(1), ..., f(d-1)&amp;lt;/math&amp;gt; Primzahlen sind. Das größtmögliche solche &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; nennt man die &amp;#039;&amp;#039;primzahlerzeugende Länge&amp;#039;&amp;#039; von &amp;lt;math&amp;gt;f(x)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Für Polynome mit der Gleichung &amp;lt;math&amp;gt;f(x)=x^2+x+q&amp;lt;/math&amp;gt; ist &amp;lt;math&amp;gt;q=41&amp;lt;/math&amp;gt; die von [[Leonhard Euler|Euler]] entdeckte größte Primzahl mit der Eigenschaft, dass &amp;lt;math&amp;gt;f(0),f(1), ..., f(q-1)&amp;lt;/math&amp;gt; Primzahlen sind. &lt;br /&gt;
&lt;br /&gt;
[[Adrien-Marie Legendre|Legendre]] stellte fest, dass Polynome mit der Gleichung &amp;lt;math&amp;gt;f(x)=2x^2+q&amp;lt;/math&amp;gt; für &amp;lt;math&amp;gt;q=3,5,11,29&amp;lt;/math&amp;gt; die größtmögliche primzahlerzeugende Länge &amp;lt;math&amp;gt;q&amp;lt;/math&amp;gt; besitzen.&lt;br /&gt;
&lt;br /&gt;
1914 fand A. Lévy heraus, dass &amp;lt;math&amp;gt;f(x)=3x^2+3x+23&amp;lt;/math&amp;gt; eine primzahlerzeugende Länge von 22 hat.&lt;br /&gt;
&lt;br /&gt;
[[Balthasar van der Pol]] und Speziali entdeckten 1951, dass &amp;lt;math&amp;gt;f(x)=6x^2+6x+31&amp;lt;/math&amp;gt; die primzahlerzeugende Länge von 29 hat.&amp;lt;ref&amp;gt;[[Paulo Ribenboim]]: Die Welt der Primzahlen 2. Aufl., Springer-Lehrbuch, Springer-Verlag Berlin Heidelberg 2011, ISBN 978-3-642-18078-1, S. 151–152.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Weitere Formeln ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;n! - 1&amp;lt;/math&amp;gt; ist prim für &amp;lt;math&amp;gt;n = 3, 4, 6, 7, 12, 14, 30, 32, 33, 38, 94, 166, \dotsc&amp;lt;/math&amp;gt; ({{OEIS|A002982}})&lt;br /&gt;
* &amp;lt;math&amp;gt;n! + 1&amp;lt;/math&amp;gt; ist prim für &amp;lt;math&amp;gt;n = 1, 2, 3, 11, 27, 37, 41, 73, 77, 116, 154, \dotsc&amp;lt;/math&amp;gt; ({{OEIS|A002981}})&lt;br /&gt;
* Primzahlen der Form &amp;lt;math&amp;gt;\operatorname{kgV}(1,\dotsc,n)+1&amp;lt;/math&amp;gt; sind: &amp;lt;math&amp;gt;2, 3, 7, 13, 61, 421, 2521, 232792561, \dotsc&amp;lt;/math&amp;gt; ({{OEIS|A049536}})&lt;br /&gt;
&lt;br /&gt;
Nach dem [[Dirichletscher Primzahlsatz|Dirichletschen Primzahlsatz]] enthält eine arithmetische Folge &amp;lt;math&amp;gt;a \cdot m + b&amp;lt;/math&amp;gt; (wobei &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt; [[Teilerfremdheit|teilerfremd]] sind und &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; die natürlichen Zahlen durchläuft) unendlich viele Primzahlen (aber auch zusammengesetzte Zahlen). Allerdings gibt es nach [[Ben Green]] und [[Terence Tao]] für jedes &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; arithmetische Folgen (festgelegt durch &amp;lt;math&amp;gt;a, b&amp;lt;/math&amp;gt;), die Primzahlen für &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; aufeinanderfolgende Werte liefern.&amp;lt;ref&amp;gt;{{MathWorld|Green-TaoTheorem|Green-Tao Theorem}}&amp;lt;/ref&amp;gt; Zum Beispiel liefert:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;math&amp;gt;43142746595714191+5283234035979900 \cdot k&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Primzahlen für &amp;lt;math&amp;gt;k=0, \dotsc, 25&amp;lt;/math&amp;gt;. Die Methode entspricht dem Fall linearer Polynome.&lt;br /&gt;
&lt;br /&gt;
== Trivialer Generator ==&lt;br /&gt;
&lt;br /&gt;
Ein trivialer Primzahlgenerator kann folgendermaßen [[Induktion (Mathematik)|induktiv]] definiert werden:&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;math&amp;gt;f(1)=2&amp;lt;/math&amp;gt;&lt;br /&gt;
# &amp;lt;math&amp;gt;f(2)=3&amp;lt;/math&amp;gt;&lt;br /&gt;
# für &amp;lt;math&amp;gt;n \geq 2&amp;lt;/math&amp;gt; ist &amp;lt;math&amp;gt;f(n+1)&amp;lt;/math&amp;gt; die auf &amp;lt;math&amp;gt;f(n)&amp;lt;/math&amp;gt; folgende Primzahl, wobei einfach alle Zahlen ab &amp;lt;math&amp;gt;f(n)+2&amp;lt;/math&amp;gt; aufsteigend darauf [[Probedivision|getestet]] werden, ob sie eine Primzahl sind.&lt;br /&gt;
&lt;br /&gt;
Dieses Verfahren ist aber recht ineffektiv, da nacheinander alle ungeraden natürlichen Zahlen getestet werden müssen. Als Alternative bietet es sich an, mittels einer [[Sieb (Zahlentheorie)|Siebmethode]], z.&amp;amp;nbsp;B. [[Sieb des Eratosthenes]] oder [[Sieb von Atkin]], eine genügend lange Liste von Primzahlen zu erstellen und diese dann bis zur gewünschten Primzahl zu durchlaufen. Dabei bestimmt man manchmal zunächst primzahlähnliche Mengen ([[Fastprimzahl]]en).&lt;br /&gt;
&lt;br /&gt;
== Satz von Wilson ==&lt;br /&gt;
&lt;br /&gt;
Eine nicht sehr praktikable Formel für alle Primzahlen beruht auf dem [[Satz von Wilson]]. Die Formel lautet unter Verwendung der [[Abrundungsfunktion]]:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;math&amp;gt;f(n) = \left\lfloor \frac{n! \bmod (n+1)}{n} \right\rfloor (n-1) + 2&amp;lt;/math&amp;gt; für natürliche Zahlen &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Nach dem Satz von Wilson ist &amp;lt;math&amp;gt;n+1&amp;lt;/math&amp;gt; prim genau dann, wenn &amp;lt;math&amp;gt;n! \bmod (n+1) = n&amp;lt;/math&amp;gt;. Daraus folgt, dass die Formel nur Primzahlen liefert und jede Primzahl außer 2 genau einmal. Denn ist &amp;lt;math&amp;gt;n+1&amp;lt;/math&amp;gt; prim, so ist &amp;lt;math&amp;gt;\left\lfloor \frac{n! \bmod (n+1)}{n} \right\rfloor =1&amp;lt;/math&amp;gt; und &amp;lt;math&amp;gt;f(n)=n+1&amp;lt;/math&amp;gt;. Ist &amp;lt;math&amp;gt;n+1&amp;lt;/math&amp;gt; nicht prim, so ist &amp;lt;math&amp;gt;\left\lfloor \frac{n! \bmod (n+1)}{n} \right\rfloor =0&amp;lt;/math&amp;gt; und &amp;lt;math&amp;gt; f(n)=2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Diophantische Mengen für Primzahlen ==&lt;br /&gt;
&lt;br /&gt;
Nach den Arbeiten zu [[Diophantische Gleichung#Hilberts zehntes Problem|Hilberts zehntem Problem]] gibt es ein System von endlich vielen diophantischen Gleichungen (Polynomen über den [[Ganze Zahl|ganzen Zahlen]]), die als Lösung alle Primzahlen und nur diese haben. Nach [[Juri Wladimirowitsch Matijassewitsch]] sollte es so ein System mit neun oder weniger Variablen geben. James P.&amp;amp;nbsp;Jones und Kollegen gaben 1976 ein System von 14 Polynomen in 26 Variablen an.&amp;lt;ref&amp;gt;James P. Jones, Daihachiro Sato, Hideo Wada, Douglas Wiens: &amp;#039;&amp;#039;Diophantine representation of the set of prime numbers.&amp;#039;&amp;#039; American Mathematical Monthly, Band 83, 1976, S.&amp;amp;nbsp;449–464.&amp;lt;/ref&amp;gt; Explizit besteht das System aus den Gleichungen:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;math&amp;gt;\alpha_0 = wz + h + j - q = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;math&amp;gt;\alpha_1 = (gk + 2g + k + 1)(h + j) + h - z = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;math&amp;gt;\alpha_2 = 16(k + 1)^3(k + 2)(n + 1)^2 + 1 - f^2 = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;math&amp;gt;\alpha_3 = 2n + p + q + z - e = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;math&amp;gt;\alpha_4 = e^3(e + 2)(a + 1)^2 + 1 - o^2 = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;math&amp;gt;\alpha_5 = (a^2 - 1)y^2 + 1 - x^2 = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;math&amp;gt;\alpha_6 = 16r^2y^4(a^2 - 1) + 1 - u^2 = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;math&amp;gt;\alpha_7 = n + \ell + v - y = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;math&amp;gt;\alpha_8 = (a^2 - 1)\ell^2 + 1 - m^2 = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;math&amp;gt;\alpha_9 = ai + k + 1 - \ell - i = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;math&amp;gt;\alpha_{10} = ((a + u^2(u^2 - a))^2 - 1)(n + 4dy)^2 + 1 - (x + cu)^2 = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;math&amp;gt;\alpha_{11} = p + \ell(a - n - 1) + b(2an + 2a - n^2 - 2n - 2) - m= 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;math&amp;gt;\alpha_{12} = q + y(a - p - 1) + s(2ap + 2a - p^2 - 2p - 2) - x = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;math&amp;gt;\alpha_{13} = z + p\ell(a - p) + t(2ap - p^2 - 1) - pm = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
mit den Variablen &amp;lt;math&amp;gt;a, \dotsc, z&amp;lt;/math&amp;gt;. Dann und nur dann, wenn eine Lösung in natürlichen Zahlen existiert, ist die Variable &amp;lt;math&amp;gt;k+2&amp;lt;/math&amp;gt; eine Primzahl.&lt;br /&gt;
&lt;br /&gt;
Das lässt sich auch in eine Ungleichung zusammenfassen:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;math&amp;gt;(k+2)(1-\alpha_0^2-\alpha_1^2-\cdots-\alpha_{13}^2) &amp;gt; 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Wenn man für die einzelnen Variablen natürliche Zahlen einsetzt, ist &amp;lt;math&amp;gt;k+2&amp;lt;/math&amp;gt; genau dann eine Primzahl, wenn die Ungleichung erfüllt ist.&lt;br /&gt;
&lt;br /&gt;
Es gibt auch ein die Primzahlen (und nur diese) erzeugendes System von &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; diophantischen Gleichungen mit nur zehn Variablen, allerdings mit sehr hohem Grad (in der Größenordnung &amp;lt;math&amp;gt;10^{45}&amp;lt;/math&amp;gt;). Nach Thoralf Skolem kann man auch immer ein solches System mit nur Polynomen höchstens vierten Grades finden, allerdings ist in diesem Fall die Zahl der Variablen sehr hoch (mindestens 58, soweit bekannt).&amp;lt;ref&amp;gt;James P. Jones: &amp;#039;&amp;#039;Universal diophantine equation.&amp;#039;&amp;#039; [[Journal of Symbolic Logic]], Band 47, 1982, S.&amp;amp;nbsp;549–571.&amp;lt;/ref&amp;gt; Die Methoden sind bisher von keinem praktischen Nutzen.&lt;br /&gt;
&lt;br /&gt;
== Formel von Mills ==&lt;br /&gt;
&lt;br /&gt;
W. H. Mills zeigte 1947,&amp;lt;ref&amp;gt;Mills: &amp;#039;&amp;#039;A prime-representing function.&amp;#039;&amp;#039; Bulletin of the AMS, Band 53, 1947, S.&amp;amp;nbsp;604.&amp;lt;/ref&amp;gt; dass es eine reelle Zahl &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; gibt, sodass&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;math&amp;gt;\left \lfloor d_n \right \rfloor = \left \lfloor A^{3^{n}} \right \rfloor&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
für alle natürlichen Zahlen &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; prim ist. Man kann unter Annahme der [[Riemannsche Vermutung|Riemannschen Vermutung]] zeigen, dass das kleinste solche &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; (die sogenannte [[Mills’ Konstante|Mill’sche Konstante]]) einen Wert von etwa &amp;lt;math&amp;gt;1{,}3063778838630806904686144926 \dots&amp;lt;/math&amp;gt; hat.&amp;lt;ref&amp;gt;{{OEIS|A051021}}.&amp;lt;/ref&amp;gt; Die mit der Formel erzeugten Primzahlen heißen Mills-Primzahlen: &amp;lt;math&amp;gt;\left \lfloor d_1 \right \rfloor = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\left \lfloor d_2 \right \rfloor = 11&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\left \lfloor d_3 \right \rfloor = 1361.&amp;lt;/math&amp;gt; Da über &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; wenig bekannt ist (noch nicht einmal, ob die Konstante rational oder irrational ist), hat die Formel aber keinen praktischen Wert.&lt;br /&gt;
&lt;br /&gt;
== Formel von Wright ==&lt;br /&gt;
&lt;br /&gt;
Eine ähnliche Formel wie die von Mills fand [[E. M. Wright]].&amp;lt;ref&amp;gt;E. M. Wright: &amp;#039;&amp;#039;A prime-representing function.&amp;#039;&amp;#039; American Mathematical Monthly, Band 58, 1951, S.&amp;amp;nbsp;616–618.&amp;lt;/ref&amp;gt; Wright zeigte, dass es eine reelle Zahl &amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt; gibt, sodass&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;math&amp;gt;\left \lfloor g_n \right \rfloor = \left \lfloor 2^{\dots^{2^{2^\alpha}}} \right \rfloor&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
prim ist für alle &amp;lt;math&amp;gt;n \ge 1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Dabei ist &amp;lt;math&amp;gt;g_n&amp;lt;/math&amp;gt; rekursiv definiert:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;math&amp;gt;g_0 = \alpha&amp;lt;/math&amp;gt;&lt;br /&gt;
: &amp;lt;math&amp;gt;g_{n+1} = 2^{g_n}&amp;lt;/math&amp;gt; für &amp;lt;math&amp;gt;n \ge 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Wright gab mit &amp;lt;math&amp;gt;\alpha = 1{,}9287800 \dots&amp;lt;/math&amp;gt; auch die ersten Dezimalstellen von &amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt; an. Das ergibt die Primzahlen &amp;lt;math&amp;gt;\left \lfloor g_1 \right \rfloor = \left \lfloor 2^{\alpha} \right \rfloor = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\left \lfloor g_2 \right \rfloor = 13&amp;lt;/math&amp;gt; und &amp;lt;math&amp;gt;\left \lfloor g_3 \right \rfloor = 16381&amp;lt;/math&amp;gt;.&lt;br /&gt;
Es zeigt sich, dass mit einem Wert von &amp;lt;math&amp;gt;\alpha \approx 1{,}9287800&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\left \lfloor g_4 \right \rfloor = \left \lfloor 2^{2^{2^{2^{\alpha}}}}\right \rfloor  = 19139664204631104...822015417386540 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(die Punkte bedeuten 4900 nicht dargestellte Dezimalstellen) eine Zahl mit 4932 Dezimalstellen ist, die aber &amp;#039;&amp;#039;gerade&amp;#039;&amp;#039; (das heißt, keine Primzahl) ist, das heißt, dieser  Wert von &amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt; muss leicht korrigiert werden.&amp;lt;ref&amp;gt;Robert Baillie: Wright&amp;#039;s Fourth Prime [https://arxiv.org/pdf/1705.09741.pdf]&amp;lt;/ref&amp;gt;&lt;br /&gt;
Für die folgenden Primzahlen braucht man noch weit mehr Dezimalstellen.&lt;br /&gt;
&lt;br /&gt;
Da die Formel auf der Kenntnis von &amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt; beruht, ist sie praktisch ebenso nutzlos wie die von Mills.&lt;br /&gt;
&lt;br /&gt;
== Conways Primzahlgenerator ==&lt;br /&gt;
&lt;br /&gt;
Für die primzahlerzeugende &amp;#039;&amp;#039;Maschine&amp;#039;&amp;#039; (PRIMEGAME) von [[John Horton Conway]]&amp;lt;ref&amp;gt;[[Richard K. Guy]]: &amp;#039;&amp;#039;Conway&amp;#039;s Prime Producing Machine.&amp;#039;&amp;#039; Mathematics Magazine, Band 56, 1983, S.&amp;amp;nbsp;26–33.&amp;lt;/ref&amp;gt; siehe [[FRACTRAN]]. Die Methode ist allerdings ebenfalls nicht praktikabel zur Generierung von Primzahllisten.&lt;br /&gt;
&lt;br /&gt;
== Primzahlgenerator für endliche Primzahlmengen ==&lt;br /&gt;
&lt;br /&gt;
[[Ross Honsberger]]&amp;lt;ref&amp;gt;Honsberger: &amp;#039;&amp;#039;More Mathematical Morsels.&amp;#039;&amp;#039; Mathematical Association of America 1991, S.&amp;amp;nbsp;108 (Morsel 20).&amp;lt;/ref&amp;gt; gibt einen einfachen Beweis für folgenden Satz:&lt;br /&gt;
&lt;br /&gt;
Man teile die ersten &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; Primzahlen beliebig auf zwei [[disjunkt]]e Mengen &amp;lt;math&amp;gt;A, B&amp;lt;/math&amp;gt; auf, sodass &amp;lt;math&amp;gt;A \cup B = \{2, \dotsc, p_n \}&amp;lt;/math&amp;gt;. Sei &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; das Produkt der Elemente von &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; und &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt; das der Elemente von &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; darf auch [[Leere Menge|leer]] sein, dann ist &amp;lt;math&amp;gt;a = 1&amp;lt;/math&amp;gt; ([[leeres Produkt]]). Falls nun &amp;lt;math&amp;gt;a+b &amp;lt; p_{n+1}^2&amp;lt;/math&amp;gt;, dann ist &amp;lt;math&amp;gt;a+b&amp;lt;/math&amp;gt; eine Primzahl, und &amp;lt;math&amp;gt;|a-b|&amp;lt;/math&amp;gt; ist prim, wenn &amp;lt;math&amp;gt;1 &amp;lt; |a-b| &amp;lt; p_{n+1}^2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Beispiel: &amp;lt;math&amp;gt;p_n=5&amp;lt;/math&amp;gt; (betrachtet werden dann nur Zahlen kleiner als &amp;lt;math&amp;gt;p_{n+1}^2=7^2=49&amp;lt;/math&amp;gt;):&lt;br /&gt;
: &amp;lt;math&amp;gt;2 \cdot 3 + 5 = 11, \quad 2 \cdot 3 - 5 = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
: &amp;lt;math&amp;gt;2 \cdot 5 + 3 = 13, \quad 2 \cdot 5 - 3 = 7&amp;lt;/math&amp;gt;&lt;br /&gt;
: &amp;lt;math&amp;gt;3 \cdot 5 + 2 = 17, \quad 3 \cdot 5 - 2 = 13&amp;lt;/math&amp;gt;&lt;br /&gt;
: &amp;lt;math&amp;gt;2 \cdot 3 \cdot 5 + 1 = 31, \quad 2 \cdot 3 \cdot 5 - 1 = 29&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Zweites Beispiel: &amp;lt;math&amp;gt;p_n=11&amp;lt;/math&amp;gt; (betrachtet werden dann nur Zahlen kleiner als &amp;lt;math&amp;gt;p_{n+1}^2=13^2=169&amp;lt;/math&amp;gt;):&lt;br /&gt;
: &amp;lt;math&amp;gt;2 \cdot 11 + 3 \cdot 5 \cdot 7 = 127&amp;lt;/math&amp;gt;&lt;br /&gt;
: &amp;lt;math&amp;gt;3 \cdot 5 \cdot 11 - 2 \cdot 7 = 151&amp;lt;/math&amp;gt;&lt;br /&gt;
Jedoch sind&lt;br /&gt;
: &amp;lt;math&amp;gt;3 \cdot 5 + 2 \cdot 7 \cdot 11 = 169,&amp;lt;/math&amp;gt;&lt;br /&gt;
: &amp;lt;math&amp;gt;2 \cdot 3 \cdot 5 \cdot 11 - 7 = 323&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;nicht&amp;#039;&amp;#039; kleiner als 169 und daher nicht prim.&lt;br /&gt;
&lt;br /&gt;
== Primzahlgenerator mit JavaScript ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!DOCTYPE html&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
&amp;lt;h1&amp;gt;Primzahlgenerator&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;ausdruck&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
anzahl = 0;&lt;br /&gt;
primzahlen = &amp;#039;&amp;#039;;&lt;br /&gt;
&lt;br /&gt;
for(var vllt_prim = 1; vllt_prim &amp;lt;= 1000; vllt_prim++)&lt;br /&gt;
{&lt;br /&gt;
	prim = true;&lt;br /&gt;
&lt;br /&gt;
	for(var nat_zahl = 1; nat_zahl &amp;lt;= 1000; nat_zahl++)&lt;br /&gt;
	{&lt;br /&gt;
		for(var teiler = 2; teiler &amp;lt;= 1000; teiler++)&lt;br /&gt;
		{&lt;br /&gt;
			if(vllt_prim/teiler == nat_zahl &amp;amp;&amp;amp; vllt_prim/teiler != 1)&lt;br /&gt;
			{&lt;br /&gt;
				prim = false;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	if(prim == true)&lt;br /&gt;
	{&lt;br /&gt;
		primzahlen += vllt_prim + &amp;#039;, &amp;#039;;&lt;br /&gt;
		anzahl++;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
primzahlen = primzahlen.substr(0, primzahlen.length - 2);&lt;br /&gt;
ergebnis = anzahl + &amp;#039; Primzahlen (von 1 bis 1000):&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;#039; + primzahlen;&lt;br /&gt;
ausdruck = document.getElementById(&amp;#039;ausdruck&amp;#039;);&lt;br /&gt;
ausdruck.innerHTML = ergebnis;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Weblinks ==&lt;br /&gt;
&lt;br /&gt;
* {{MathWorld|PrimeFormulas|Prime Formulas}}&lt;br /&gt;
&lt;br /&gt;
== Einzelnachweise ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Kategorie:Primzahl]]&lt;br /&gt;
[[Kategorie:Zahlentheoretischer Algorithmus]]&lt;br /&gt;
[[Kategorie:Ungelöstes Problem der Informatik]]&lt;/div&gt;</summary>
		<author><name>~2025-47925-7</name></author>
	</entry>
</feed>