a prime primer

15
Prime Time December 2008 Morten Jagd Christensen Thrane & Thrane A/S

Upload: morten-christensen

Post on 17-Mar-2016

220 views

Category:

Documents


0 download

DESCRIPTION

A talk (in progress) on primes and primality tests

TRANSCRIPT

Page 1: A Prime Primer

Prime Time

December 2008

Morten Jagd Christensen

Thrane & Thrane A/S

Page 2: A Prime Primer

is

25288891392479400456592804986000222944998316082937128866378556017873124536111976520731519116376124029996303932610315220549847432414563643

prime?

Page 3: A Prime Primer

313-05-2009Skriv titel på præsentation

Agenda

Number theoryProof of infinite number of primesDistribution of primesFermat s little theorem

Algorithms for primality testing

Testing small primes

Using your graphics card for fast calculationsOpenGL graphics accelerationOpenGL Shading Language programmable graphics pipeline

Testing large primesFast multiplications

GNU Multi Precision library

Page 4: A Prime Primer

413-05-2009Skriv titel på præsentation

What is a prime number?

A number which is only divisible by it self and 12 is the only even prime numberOdd prime numbers end in 1, 3, 7 or 9

All natural numbers are uniquely described by prime factors

4=22 6=2 2 8=23 ... 2100 = 22 3 52 7 etc.can be found by factoring into primes

Consider the positive integers 1,2,3,4,.....Primes behave like statistical fluctuations taking up as muchroom as possible considering the requirement of a completesequence of integers

Page 5: A Prime Primer

513-05-2009Skriv titel på præsentation

How many primes are there?

Euclid (300 BC) proved there are infinitely many primes

Construct the following new number

m= (2 3 5 7 11 13 17... n) + 1

Neither of 2..n divides m

-> There must be at least one prime larger than n thatdivides m

Page 6: A Prime Primer

613-05-2009Skriv titel på præsentation

Mother of prime algorithms

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 41

Page 7: A Prime Primer

713-05-2009Skriv titel på præsentation

Mother of prime algorithms

2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2223 24 25 26

27 28 29 30 31 32 33 34 35 36 37 38 39 40 41

Page 8: A Prime Primer

813-05-2009Skriv titel på præsentation

Mother of prime algorithms

2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2223 24 25 26

27 28 29 30 31 32 33 34 35 36 37 38 39 40 41

Page 9: A Prime Primer

913-05-2009Skriv titel på præsentation

Mother of prime algorithms

2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2223 24 25 26

27 28 29 30 31 32 33 34 35 36 37 38 39 40 41

Page 10: A Prime Primer

1013-05-2009Skriv titel på præsentation

Mother of prime algorithms

2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2223 24 25 26

27 28 29 30 31 32 33 34 35 36 37 38 39 40 41

Page 11: A Prime Primer

1113-05-2009Skriv titel på præsentation

Fermat s little theorem

Composite testif a < p

)1( p

Page 12: A Prime Primer

1213-05-2009Skriv titel på præsentation

Fermat s little theorem

Composite testif a < p

so (p,a) = (503, 2)2^502 = 1 (mod 503) could be prime

and (p,a) = (501,2)2^501 = 4 (mod 500) is composite

)1( p

Page 13: A Prime Primer

By the way25288891392479400456592804986000222944998316082937128866378556017873124536111976520731519116376124029996303932610315220549847432414563643

is prime

Page 14: A Prime Primer

1413-05-2009Skriv titel på præsentation

References

D.E. Knuth The art of Computer Programming

Numerical Recipes in C++

GMP Manual

OpenGL Orange Book

Page 15: A Prime Primer

This document was created with Win2PDF available at http://www.daneprairie.com.The unregistered version of Win2PDF is for evaluation or non-commercial use only.