Number Theory - 2

Primes

  1. Primes

    An integer p > 1 is said to be prime if its only positive divisors are 1 and p. Thus 2, 3, 5, 7, 11, 13, 17, 19, 23 are all prime. A number n > 1 that is not prime is said to be composite.

    There is an algorithm for finding all primes less than n. Start by listing the integers from 2 to n. Cross out all proper multiples ( > 2) of 2. Find the first surviving number after 2, which will, of course, be 3. Cross out all proper multiples of 3. Then the next survivor is prime. Cross out all of its proper multiples. Continue until you reach a survivor greater than the square root of n. Then all surviving numbers are prime.

    We illustrate the algorithm for n = 40. First delete multiples of 2:
    2 3 4 5  6 7 8 9 10
    11 12 13 14 15 16 17 18 19 20
    21 22 23 24 25 26 27 28 29 30
    31 32 33 34 35 36 37 38 39 40
    
    Now continue by crossing out multiples of 3:
    2 3 4 5  6 7 8 9 10
    11 12 13 14 15 16 17 18 19 20
    21 22 23 24 25 26 27 28 29 30
    31 32 33 34 35 36 37 38 39 40
    
    Now cross out proper multiples of 5. Note that we start with 5*5, since all smaller multiples of 5 have already been crossed out.
    2 3 4 5  6 7 8 9 10
    11 12 13 14 15 16 17 18 19 20
    21 22 23 24 25 26 27 28 29 30
    31 32 33 34 35 36 37 38 39 40
    
    Since 7*7 is greater than our limit of 40, we can now quit.

    This algorithm is called the sieve of Eratosthenes

  2. Prime factorization.

    Every n > 1 has a unique factorization into primes. For example, 16335 = 33*51*112.

    In general, we can write

    where the pi are distinct primes and the ei are exponents > 0.

    Theorem. If p is a prime and p | ab, then either p | a or p | b.
    Proof. If p does not divide a, then gcd(p, a) = 1. Then p | b by a theorem in the preceding note.

    If

    ,
    then
    .
    We take the minimum of each exponent because we need a number that divides both m and n, but is as large as possible. For example, gcd(800,360) = gcd(253052,233251) = 233051 = 40.

  3. There are infinitely many primes.

    This is known as Euclid's Theorem. For proof, suppose by way of contradiction that there are only finitely many primes p1, p2, ..., pk. Consider the number n=p1p2...pk+1. If you divide n by any pi, then you get remainder 1. But n must have some prime factor. So we reach a contradiction; there must be a prime that we did not list.

  4. Factoring is hard.

    Factoring is hard in the computer science sense; as far as is known, it takes exponential time. By way of illustration, consider the Fermat numbers Fn=22^n+1. The first few are F0=3, F1=5, F2=17, F3=257, F4=65537, and F5=232+1=4294967297. Fermat conjectured that all of the Fermat numbers are prime, but Euler found the factor 641 of F4.

    In 1905, Morehead and Western, working independently, proved that F7 = 2128+1 = 340282366920938463463374607431768211457 is not prime. They did not factor it. Factorization had to wait until 1971, when Brillhart and Morrison used a Control Data supercomputer to find the factorization
    F7=59649589127497217*5704689200685129054721. Both factors are prime.
    F14, a number with 4933 digits, is known to be composite, but none of its factors has been found. For more information on the current status of Fermat numbers, see a compilation by W. Keller.
    The difficulty of factoring large integers is basic to the most popular algorithms for secure transfer of data in use today.