|
Fermat's Little Theorem (Pierre de Fermat was born on 17th August 1601 in Montauban, France and
he died on 12th January 1665 in Castres, France). If P is prime then: B ^ P = B (mod P) <=> B ^ (P-1) = 1 (mod P) All prime numbers will pass this test, but unfortunately some composite numbers can also pass this test. If a value failed this test then the value is certain to be composite, so this Fermat prime test is to check whether a given number is composite or not. If a number passed the test then a further test is required to check primality of the number. Example (1): Number to test for primality: 7 Example (2): Number to test for primality: 9 Other bigger values can't be tested many times with different values
of B (1 < B < (P-1)) because it consumes too much time, so after
several times and it still passed the test we just use other algorithm
to determine the primality or just simply ASSUME it is a prime. |
|
|
Author
Site Map Disclaimer
HMaxF Ultimate Recursive Lossless Compression Research 2001 - 2003 (c) All Rights Reserved. |
|