Prime Time December 2008 Morten Jagd Christensen Thrane & Thrane A/S
is 2528889139247940045659280498600022294499831608 2937128866378556017873124536111976520731519116 376124029996303932610315220549847432414563643 prime?
Agenda Number theory Proof of infinite number of primes Distribution of primes Fermat s little theorem
Algorithms for primality testing Testing small primes Using your graphics card for fast calculations OpenGL graphics acceleration OpenGL Shading Language programmable graphics pipeline
Testing large primes Fast multiplications
GNU Multi Precision library Skriv titel pĂĽ prĂŚsentation
13-05-2009
3
What is a prime number? A number which is only divisible by it self and 1 2 is the only even prime number Odd 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 much room as possible considering the requirement of a complete sequence of integers Skriv titel pĂĽ prĂŚsentation
13-05-2009
4
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 that divides m
Skriv titel pĂĽ prĂŚsentation
13-05-2009
5
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
Skriv titel pĂĽ prĂŚsentation
13-05-2009
6
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
Skriv titel pĂĽ prĂŚsentation
13-05-2009
7
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
Skriv titel pĂĽ prĂŚsentation
13-05-2009
8
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
Skriv titel pĂĽ prĂŚsentation
13-05-2009
9
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
Skriv titel pĂĽ prĂŚsentation
13-05-2009
10
Fermat s little theorem Composite test if a < p
( p 1)
Skriv titel pĂĽ prĂŚsentation
13-05-2009
11
Fermat s little theorem Composite test if a < p
( p 1)
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
Skriv titel pĂĽ prĂŚsentation
13-05-2009
12
By the way 252888913924794004565928049860002229449983160829 371288663785560178731245361119765207315191163761 24029996303932610315220549847432414563643 is prime
References D.E. Knuth The art of Computer Programming Numerical Recipes in C++ GMP Manual OpenGL Orange Book
Skriv titel pĂĽ prĂŚsentation
13-05-2009
14
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.