This commit is contained in:
Miloslav Ciz 2025-03-27 21:46:32 +01:00
parent a8a9ce5cfc
commit 3fe12a0939
17 changed files with 1991 additions and 1979 deletions

View file

@ -1,6 +1,6 @@
# Prime Number
Prime number (or just *prime*) is a [whole](integer.md) positive [number](number.md) only divisible by 1 and itself, except for the number [1](one.md). I.e. prime numbers are 2, 3, 5, 7, 11, 13, 17 etc. Non-prime numbers are called *composite numbers*. Ask any mathematician and you'll learn that prime numbers are more than just highly important, they are [interesting](interesting.md) and mysterious for their intricate properties and distribution among other numbers, they have for millennia fascinated [mathematicians](math.md); nowadays they are studied in the math subfield called [number theory](number_theory.md). Primes are also of practical use, for example in [asymmetric cryptography](asymmetric_cryptography.md). Primes can be seen as the opposite of [highly composite numbers](highly_composite_number.md) (also antiprimes, numbers that have more divisors than any lower number). Numbers of comparable status and similarly mysterious properties to prime numbers are for example [perfect numbers](perfect_number.md), whose importance is however a bit diminished by current lack of practical use.
Prime number (or just *prime*) is a [whole](integer.md) positive [number](number.md) only divisible by 1 and itself, except for the number [1](one.md). I.e. prime numbers are 2, 3, 5, 7, 11, 13, 17 etc. Non-prime numbers are called *composite numbers*. The simplicity of definition might bring about an impression that prime numbers are something plain, akin to odd numbers for example, but this couldn't be further from the truth: you'll learn from any mathematician that primes are not only vitally important to their field, but immensely [interesting](interesting.md), complex and even mysterious for their intricate properties and relatively "random" distribution among other numbers, they have for millennia fascinated [mathematicians](math.md) exactly because they are so simple and complex at the same time, and they're still not fully understood to this day. Nowadays they are studied by so called [number theory](number_theory.md), a subfield of [mathematics](math.md). Primes are also of practical use, for example in [asymmetric cryptography](asymmetric_cryptography.md). Primes can be seen as the opposite of [highly composite numbers](highly_composite_number.md) (also antiprimes, numbers that have more divisors than any lower number). Numbers of comparable status and similarly mysterious properties to prime numbers are for example [perfect numbers](perfect_number.md), whose importance is however a bit diminished by current lack of practical use.
```
.##.#.#...#.#...#.#...#.....#.#.....#...#.#...#.....#.....#.#.....#...
@ -18,11 +18,11 @@ The unique factorization can also nicely be used to encode [multisets](multiset.
When in 1974 the Arecibo radio message was sent to space to carry a message for [aliens](alien.md), the resolution of the bitmap image it carried was chosen to be 73 x 23 pixels -- two primes. This was cleverly done so that when aliens receive the 1679 sequential values, there are only two possible ways to interpret them as a 2D bitmap image: 23 x 73 (incorrect) and 73 x 23 (correct). This increased the probability of correct interpretation against the case of sending an arbitrary resolution image.
**There are infinitely many prime numbers**. The proof is pretty simple (shown below), however it's pretty interesting that it has still not been proven whether there are infinitely many **[twin primes](twin_prime.md) (primes that differ by 2)**, that seems to be an extremely difficult question. Another simple but unproven conjecture about prime numbers if [Goldbach's conjecture](goldbachs_conjecture.md) stating that every even number greater than 2 can be written as a sum of two primes.
**There are infinitely many prime numbers**. The proof is quite elementary (shown below), however it's pretty fascinating that it has still not been proven whether there are infinitely many **[twin primes](twin_prime.md) (primes that differ by 2)**, which, despite its similarity to the former problem, shows to be an incomparably more difficult question to answer. Another simple but unproven conjecture related to prime numbers is [Goldbach's conjecture](goldbachs_conjecture.md) stating that every even number greater than 2 can be written as a sum of two primes.
Euklid's [proof](proof.md) shows there are infinitely many primes, it is done by contradiction and goes as follows: suppose there are finitely many primes *p1*, *p2*, ... *pn*. Now let's consider a number *s* = *p1* * *p2* * ... * *pn* + 1. This means *s* - 1 is divisible by each prime *p1*, *p2*, ... *pn*, but *s* itself is not divisible by any of them (as it is just 1 greater than *s* and multiples of some number *q* greater than 1 have to be spaced by *q*, i.e. more than 1). If *s* isn't divisible by any of the considered primes, it itself has to be a prime. However that is in contradiction with the original assumption that *p1*, *p2*, ... *pn* are all existing primes. Therefore a finite list of primes cannot exist, there have to be infinitely many of them.
Euklid's [proof](proof.md) shows there are infinitely many primes, it is conducted by contradiction and goes as follows: suppose there are finitely many primes *p1*, *p2*, ... *pn*. Now let's consider a number *s* = *p1* * *p2* * ... * *pn* + 1. This means *s* - 1 is divisible by each prime *p1*, *p2*, ... *pn*, but *s* itself is not divisible by any of them (as it is just 1 greater than *s* and multiples of some number *q* greater than 1 have to be spaced by *q*, i.e. more than 1). If *s* isn't divisible by any of the considered primes, it itself has to be a prime. However that is in contradiction with the original assumption that *p1*, *p2*, ... *pn* are all existing primes. Therefore a finite list of primes cannot exist, there have to be infinitely many of them.
**Distribution and occurrence of primes**: the occurrence of primes seems kind of """[random](random.md)""" (kind of like digits of [decimal](decimal.md) representation of [pi](pi.md)), without a simple pattern, however hints of patterns appear such as the [Ulam spiral](ulam_spiral.md) -- if we plot natural numbers in a square spiral and mark the primes, we can visually distinguish dimly appearing 45 degree diagonals as well as horizontal and vertical lines. Furthermore the **density of primes decreases** the further away we go from 0. The *prime number theorem* states that a number randomly chosen between 0 and *N* (for large *N*) has approximately 1/log(N) probability of being a prime. **Prime counting function** is a function which for *N* tells the number of primes smaller or equal to *N*. While there are 25 primes under 100 (25%), there are 9592 under 100000 (~9.5%) and only 50847534 under 1000000000 (~5%).
**Distribution and occurrence of primes**: the occurrence of primes seems kind of """[random](random.md)""" (a bit like digits of [decimal](decimal.md) representation of [pi](pi.md)), without a simple pattern. Obviously *randomness* here doesn't stand for "true randomness", as primality of any number is perfectly [determined](determinism.md) and [decidable](decidability.md), but as far as our knowledge reaches, there aren't simple ways to perfectly predict for example occurrence of primes with a simple, fast to compute formula, i.e. *randomness* rather stands for [chaos](chaos.md). Hints of patterns appear such as the [Ulam spiral](ulam_spiral.md) -- upon plotting natural numbers in a square spiral and marking the primes, we visually perceive a dimly appearing 45 degree diagonals as well as horizontal and vertical lines. Furthermore the **density of primes decreases** the further away we go from 0. The *prime number theorem* states that a number randomly chosen between 0 and *N* (for large *N*) has approximately 1/log(N) [probability](probability.md) of being a prime. **Prime counting function** is a [function](function.md) which for *N* tells the number of primes smaller or equal to *N*. While there are 25 primes under 100 (25%), there are 9592 under 100000 (~9.5%) and only 50847534 under 1000000000 (~5%).
```
, , , ', ' ,' , , '
@ -75,7 +75,7 @@ Here are twin prime numbers under 1000: 3, 5, 7, 11, 13, 17, 19, 29, 31, 41, 43,
There also exists a term **pseudoprime** -- it stands for a number which is not actually a prime but appears so because it passes some quick primality tests.
**Higher order primes**, also **superprimes** or prime-indexed primes, are primes that occupy prime numberth position within prime numbers, i.e. one of first higher order primes is for example number 5 because it is the 3rd prime and 3 itself is a prime. 5 is also one of second order higher primer numbers because it is 2nd first higher order prime number and 2 is a prime number. Etc. So we may generalize this concept to a prime number order *R(x)*, which says the highest order that number *x* achieves in this sense, with *R(x) = 0* meaning *x* is not prime at all. One of very high superprimes is for example number 174440041 (lowest number with *R(x) = 12*). Prime orders for numbers up to 1000 are (leaving out the ones with order 0):
**Higher order primes**, also **superprimes** or prime-indexed primes, are primes occupying prime numberth position within prime numbers, i.e. one of first higher order primes is for example number 5 because it is the 3rd prime and 3 itself is a prime. 5 is also one of second order higher primer numbers because it is 2nd first higher order prime number and 2 is a prime number. Etc. So we may generalize this concept to a prime number order *R(x)*, which says the highest order that number *x* achieves in this sense, with *R(x) = 0* meaning *x* is not prime at all. One of very high superprimes is for example number 174440041 (lowest number with *R(x) = 12*). Prime orders for numbers up to 1000 are (leaving out the ones with order 0):
2: 1, 3: 2, 5: 3, 7: 1, 11: 4, 13: 1, 17: 2, 19: 1, 23: 1, 29: 1, 31: 5, 37: 1, 41: 2, 43: 1, 47: 1, 53: 1, 59: 3, 61: 1, 67: 2, 71: 1, 73: 1, 79: 1, 83: 2, 89: 1, 97: 1, 101: 1, 103: 1, 107: 1, 109: 2, 113: 1, 127: 6, 131: 1, 137: 1, 139: 1, 149: 1, 151: 1, 157: 2, 163: 1, 167: 1, 173: 1, 179: 3, 181: 1, 191: 2, 193: 1, 197: 1, 199: 1, 211: 2, 223: 1, 227: 1, 229: 1, 233: 1, 239: 1, 241: 2, 251: 1, 257: 1, 263: 1, 269: 1, 271: 1, 277: 4, 281: 1, 283: 2, 293: 1, 307: 1, 311: 1, 313: 1, 317: 1, 331: 3, 337: 1, 347: 1, 349: 1, 353: 2, 359: 1, 367: 2, 373: 1, 379: 1, 383: 1, 389: 1, 397: 1, 401: 2, 409: 1, 419: 1, 421: 1, 431: 3,
433: 1, 439: 1, 443: 1, 449: 1, 457: 1, 461: 2, 463: 1, 467: 1, 479: 1, 487: 1, 491: 1, 499: 1, 503: 1, 509: 2, 521: 1, 523: 1, 541: 1, 547: 2, 557: 1, 563: 2, 569: 1, 571: 1, 577: 1, 587: 2, 593: 1, 599: 3, 601: 1, 607: 1, 613: 1, 617: 2, 619: 1, 631: 1, 641: 1, 643: 1, 647: 1, 653: 1, 659: 1, 661: 1, 673: 1, 677: 1, 683: 1, 691: 1, 701: 1, 709: 7, 719: 1, 727: 1, 733: 1, 739: