21
11/29/2010 1 Primes Rational, Gaussian, Industrial Strength, etc Robert Campbell

Primes - UMBCcampbell/MEPP/Primes/Primes.pdf · The number of primes less than x is approximately x/log(x) 11/29/2010 11 Counting Primes (III) ... Elementary Number Theory, Jones

  • Upload
    dinhnhi

  • View
    225

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Primes - UMBCcampbell/MEPP/Primes/Primes.pdf · The number of primes less than x is approximately x/log(x) 11/29/2010 11 Counting Primes (III) ... Elementary Number Theory, Jones

11/29/2010 1

Primes Rational, Gaussian, Industrial Strength, etc

Robert Campbell

Page 3: Primes - UMBCcampbell/MEPP/Primes/Primes.pdf · The number of primes less than x is approximately x/log(x) 11/29/2010 11 Counting Primes (III) ... Elementary Number Theory, Jones

11/29/2010 3

Everybody Knows …

Everybody knows what a prime is: 2, 3, 5, 7, 9, 11, …

p is prime if its only positive divisors are 1 and p

p is prime if, whenever p divides ab, then either p

divides a and/or p divides b

Any number N factors into a product of primes

uniquely (up to order)

p is prime if, whenever p divides ab, then either p

divides a and/or p divides b

Any number N factors into a product of primes

uniquely (up to order)

Page 4: Primes - UMBCcampbell/MEPP/Primes/Primes.pdf · The number of primes less than x is approximately x/log(x) 11/29/2010 11 Counting Primes (III) ... Elementary Number Theory, Jones

11/29/2010 4

Primal Questions

Definition

Counting

Finding and Identifying

Page 5: Primes - UMBCcampbell/MEPP/Primes/Primes.pdf · The number of primes less than x is approximately x/log(x) 11/29/2010 11 Counting Primes (III) ... Elementary Number Theory, Jones

11/29/2010 5

Definition:

p is prime if its only positive divisors are 1 and p

p is prime if, whenever p divides ab, then either p divides a

and/or p divides b

Definition(s)

Definition:

p is irreducible if its only positive divisors are 1 and p

p is prime if, whenever p divides ab, then either p divides a

and/or p divides b

Thm: If p is prime then p is irreducibleLet a be a divisor of p, so p=ab for some b

Then p divides a and/or p divides b (as p is prime)

Case 1: p divides a. So a=pc, hence a=abc, so 1=bc and b=1. Thus a = p.

Case 2: p divides b. Similar argument - thus b = p and a = 1

Thm: If p is irreducible then p is prime

Proof requires division algorithm Euclidean Algorithm

Page 6: Primes - UMBCcampbell/MEPP/Primes/Primes.pdf · The number of primes less than x is approximately x/log(x) 11/29/2010 11 Counting Primes (III) ... Elementary Number Theory, Jones

11/29/2010 6

Division & Euclidean Algorithms

Division Algorithm/Property

Given positive integers a and b there are integers r and q with

a = bq + r and 0 ≤ r < b

Euclidean Algorithm

Given a and b, compute their greatest common divisor

(efficiently)

Page 7: Primes - UMBCcampbell/MEPP/Primes/Primes.pdf · The number of primes less than x is approximately x/log(x) 11/29/2010 11 Counting Primes (III) ... Elementary Number Theory, Jones

11/29/2010 7

Euclidean Algorithm (II)

Example - Compute gcd of 120 and 222:120 222

120 222-120=102

120-102=18 102

18 102-5*18=12

18-12=6 12

6 12-2*6=0

Page 8: Primes - UMBCcampbell/MEPP/Primes/Primes.pdf · The number of primes less than x is approximately x/log(x) 11/29/2010 11 Counting Primes (III) ... Elementary Number Theory, Jones

11/29/2010 8

Finding Primes

Sieve of Eratosthenes

1 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

1 2

Primes: 2

1 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

1 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

Primes: 2, 3

1 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

Primes: 2, 3, 5

1 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

Primes: 2, 3, 5, 7

1 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

Primes: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31

Page 9: Primes - UMBCcampbell/MEPP/Primes/Primes.pdf · The number of primes less than x is approximately x/log(x) 11/29/2010 11 Counting Primes (III) ... Elementary Number Theory, Jones

11/29/2010 9

Counting Primes

There are an infinite number of prime numbers.

Proof: Assume not. So p1, … , pn is a list of all primes.

Then construct N = p1•…• pn +1 and note that none of the known

primes divides it. Thus N is prime – we have a contradiction.

Thus our assumption is incorrect – there are infinite primes.

Can we do better?

Page 10: Primes - UMBCcampbell/MEPP/Primes/Primes.pdf · The number of primes less than x is approximately x/log(x) 11/29/2010 11 Counting Primes (III) ... Elementary Number Theory, Jones

11/29/2010 10

Counting Primes (II)

π(x) := The number of primes no greater than x

π(10) = #{2, 3, 5, 7} = 4

π(20) = #{2, 3, 5, 7, 11, 13, 17, 19} = 8

π(100) = 25; π(1000) = 168; π(10000) = 1229; π(100000) = 9592;

Prime Number Theorem (Conjecture)

The number of primes less than x is approximately x/log(x)

Page 11: Primes - UMBCcampbell/MEPP/Primes/Primes.pdf · The number of primes less than x is approximately x/log(x) 11/29/2010 11 Counting Primes (III) ... Elementary Number Theory, Jones

11/29/2010 11

Counting Primes (III)

Conjectured

Gauss (1791? First published 1863)

Legendre (1798)

Proven

Hadamard (1896)

de la Vallée Poussin (1896)

Further work – Riemann Hypothesis

Page 12: Primes - UMBCcampbell/MEPP/Primes/Primes.pdf · The number of primes less than x is approximately x/log(x) 11/29/2010 11 Counting Primes (III) ... Elementary Number Theory, Jones

11/29/2010 12

Identifying Primes

Proofs – Given a number prove that it is prime

Tests – “Industrial Strength Primes”

Page 13: Primes - UMBCcampbell/MEPP/Primes/Primes.pdf · The number of primes less than x is approximately x/log(x) 11/29/2010 11 Counting Primes (III) ... Elementary Number Theory, Jones

11/29/2010 13

Identifying Primes (II)

[Fermat’s Little Theorem] If p is prime and p does not divide a,

then p divides (ap – a)

Proof: [Simple, but not today]

35 is not prime as:

Let p = 35 and a = 2

Compute (235 – 2) = 34359738366

Note that 35 does not divide 34359738366

17 might be prime as:

Let p = 17 and a = 3

Compute (317 – 3) = 129140160

Note that 17 divides 129140160 (in fact 129140160 = (17)(7596480))

Page 14: Primes - UMBCcampbell/MEPP/Primes/Primes.pdf · The number of primes less than x is approximately x/log(x) 11/29/2010 11 Counting Primes (III) ... Elementary Number Theory, Jones

11/29/2010 14

Efficiency Questions

Even/Odd Arithmetic:

Modular Arithmetic & Russian Peasants

+ Even Odd

Even Even Odd

Odd Odd Even

* Even Odd

Even Even Even

Odd Even Odd

Modular (Residue) Arithmetic: [Example: Mod 5]

+ 0 1 2 3 4

0 0 1 2 3 4

1 1 2 3 4 0

2 2 3 4 0 1

3 3 4 0 1 2

4 4 0 1 2 3

* 0 1 2 3 4

0 0 0 0 0 0

1 0 1 2 3 4

2 0 2 4 1 3

3 0 3 1 4 2

4 0 4 3 2 1

Page 15: Primes - UMBCcampbell/MEPP/Primes/Primes.pdf · The number of primes less than x is approximately x/log(x) 11/29/2010 11 Counting Primes (III) ... Elementary Number Theory, Jones

11/29/2010 15

Identifying Primes (III)

101 might be prime as:Let p = 101 and a = 2

Compute 2101 (mod 101)21 = 2

22 = (21)2 = 4

24 = (22)2 = 42 = 16

28 = (24)2 = 162 = 256 = 54 (mod 101)

216 = (28)2 = 542 = 2916 = 88 (mod 101)

232 = (216)2 = 882 = 7744 = 68 (mod 101)

264 = (232)2 = 682 = 4624 = 79 (mod 101)

2101 = 264+32+4+1 = (264)(232)(24)(21)=(79)(68)(16)(2)=171904 = 2 (mod 101)

Try this for 5446367

But … try this for 561

Page 16: Primes - UMBCcampbell/MEPP/Primes/Primes.pdf · The number of primes less than x is approximately x/log(x) 11/29/2010 11 Counting Primes (III) ... Elementary Number Theory, Jones

11/29/2010 16

Open Questions

Find integers a, b, c and

n>2 with an + bn = cn (FLT)

Any even integer greater than 2 is the sum of

two primes (Goldbach) [e.g. 36 = 29 + 7]

Are there an infinite number of successive

odd numbers which are prime? (Twin Prime)

[e.g. {3,5}, {5,7},…, {281, 283}, …]

Is there a prime of the form p = 22n + 1 for

n>4? (Fermat Prime) [e.g. F3 = 223 + 1 = 257]

Page 17: Primes - UMBCcampbell/MEPP/Primes/Primes.pdf · The number of primes less than x is approximately x/log(x) 11/29/2010 11 Counting Primes (III) ... Elementary Number Theory, Jones

11/29/2010 17

Extension: Gaussian Integers

Consider the complex numbers with integer

coefficients: {n + mi} = Z[-1]

All the “nice properties” hold:

There are an infinite number of irreducibles: 3, 1 i, 7, 2 i, …

Unique factorization into irreducibles (up to order and

multiples of i and 1)

We can sieve to find primes

We can test for primality

Page 19: Primes - UMBCcampbell/MEPP/Primes/Primes.pdf · The number of primes less than x is approximately x/log(x) 11/29/2010 11 Counting Primes (III) ... Elementary Number Theory, Jones

11/29/2010 19

Identifying GI Primes

Given a prime p, can we test to see if it is prime?

Fermat’s Little Thm (extended to Gaussian Integers)

If p is a Gaussian prime, and p does not divide a, then p

divides (aN(p) – a), where N(p) = pp* is the norm of p.

Examples:

(1+i)49 – (1+i) = 0 (mod 7), so 7 is probably a Gaussian prime

(2+i)13 – (2+i) = 0 (mod 2+3i), so 2+3i is probably a GI prime

(2+i)34 - (2+i) = 1 + 3i (mod 5+3i), so 5+3i is not a GI prime

Page 20: Primes - UMBCcampbell/MEPP/Primes/Primes.pdf · The number of primes less than x is approximately x/log(x) 11/29/2010 11 Counting Primes (III) ... Elementary Number Theory, Jones

11/29/2010 20

A Counterexample

Consider Z[-6] = {n + m -6}

Find primes by sieving

The only units are 1

2, 3, -6, 1+ -6, … are irreducible

But …

6 = (-1)(-6)2

6 = (2)(3)

Factorization is not unique

-6 divides 6 and 6 = (2)(3), but -6 divides neither 2 nor 3

Z[-6] has irreducibles, but no primes

Page 21: Primes - UMBCcampbell/MEPP/Primes/Primes.pdf · The number of primes less than x is approximately x/log(x) 11/29/2010 11 Counting Primes (III) ... Elementary Number Theory, Jones

11/29/2010 21

References & Further Reading

The Elements, Euclid (ca 300 BC) (trans Thomas Heath), Dover Publ

http://aleph0.clarku.edu/~djoyce/java/elements/elements.html

Elementary Number Theory, Jones & Jones, Springer, 1998

The Book of Numbers, Conway & Guy, Copernicus, 1996

Prime Numbers, A Computational Perspective, Crandall & Pomerance, Telos Publ, 2001

Factorization and Primality Testing, Bressoud, Springer, 1989

Algebraic Number Theory and Fermat’s Last Thm, 3rd Ed, Stewart & Tall, Peters Publ, 2002

The Primes Pages http://www.utm.edu/research/primes/

Computational Number Theoryhttp://www.math.umbc.edu/~campbell/NumbThy/Class/