This document discusses prime numbers. It defines a prime number as a positive number that is only divisible by one and itself. Some key facts provided include: the first 25 prime numbers; the definition of a composite number; algorithms for determining if a number is prime like the sieve of Eratosthenes; the largest known prime number discovered so far; and the importance of prime numbers in cryptography. The document also provides an example of how the sieve of Eratosthenes algorithm works to find all prime numbers below a given value.
2. What is a prime number?
◦ A prime number is a positive number that is only divisible by one and itself.
◦ In another word, a prime number is a natural number p >1 which cannot be
expressed as the product of two smaller natural numbers. Thus, a prime
number has exactly two positive divisors. The first twenty-five primes: 2, 3,
5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89 . . .
◦ N.B : 1 is not a prime number though it is also divisible by one and
itself.
3. Prime and Composite Number
A composite number is a positive integer that can be
formed by multiplying two smaller positive integers.
5. Some facts about Prime Number
1. The only even prime number is 2. All other even numbers can be
divided by 2.
2. If the sum of a number's digits is a multiple of 3, that number can be
divided by 3.
3. No prime number greater than 5 ends in a 5. Any number greater
than 5 that ends in a 5 can be divided by 5.
4. Zero and 1 are not considered prime numbers.
5. Except for 0 and 1, a number is either a prime number or a composite
number. A composite number is defined as any number, greater than
1, that is not prime.
6. How to determine if a number is prime
◦ Various algorithms have been formulated in an attempt to generate ever-larger prime
numbers. For example, suppose n is a whole number, and it is not yet known if n is
prime or composite -- a positive number that can be made by multiplying two
smaller integers together. First, take the square root -- or the 1/2 power -- of n; then
round this number up to the next highest whole number and call the result m. Then
find all of the following quotients:
qm = n / m
q(m-1) = n / (m-1)
q(m-2) = n / (m-2)
q(m-3) = n / (m-3)
. . .
q3 = n / 3
q2 = n / 2
◦ The number n is prime if -- and only if -- none of the q's, as derived above, are whole
numbers.
7. The greatest known prime number so far?
◦ On January 2018, the largest known prime number is 2⁷⁷²³²⁹¹⁷- 1, a
number with 23,249,425 digits which is one million more digits than the
previous record holder, was found by the Great Internet Mersenne
Prime Search, named after the 17thcentury French monk Marin
Mersenne.
8. Prime numbers and cryptography
◦ Encryption always follows a fundamental rule: the algorithm -- or the
actual procedure being used -- doesn't need to be kept secret, but the
key does. Even the most sophisticated hacker in the world will be
unable to decrypt data as long as the key remains secret -- and prime
numbers are very useful for creating keys. For example, the strength
of public/private key encryption lies in the fact that it's easy to calculate
the product of two randomly chosen prime numbers, but it can be very
difficult and time consuming to determine which two prime numbers
were used to create an extremely large product, when only the product
is known.
9. Prime numbers and cryptography Cont…
In RSA (Rivest-Shamir-Adleman) public key cryptography, prime numbers are always supposed
to be unique. The primes used by the Diffie-Hellman key exchange and the Digital Signature
Standard (DSS) cryptography schemes, however, are frequently standardized and used by a
large number of applications.
10. Prime Number Generation Algorithm
There are a lots of algorithm but the sieve of Eratosthenes is
one of the most efficient ways to find all primes smaller than n
when n is smaller than 10 million or so.
11. Explanation of Sieve with Example
◦ Let us take an example when n = 50. So we need to print all print numbers smaller than or equal to 50.
◦ We create a list of all numbers from 2 to 50.
◦ According to the algorithm we will mark all the numbers which are divisible by 2 and are greater than or
equal to the square of it.
12. ◦ Now we move to our next unmarked number 3 and mark all the numbers which are multiples of
3 and are greater than or equal to the square of it.
◦ We move to our next unmarked number 5 and mark all multiples of 5 and are greater than or
equal to the square of it.
13. ◦ We continue this process and our final table will look like below:
◦ So the prime numbers are the unmarked ones: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31,
37, 41, 43, 47.