~ Office Supplies ~~ Buy Posters ~~ A-Z Products ~~ Website Advertising


Fermat primality test - Wikipedia

<<Up     Contents

Fermat primality test

Fermat's little theorem states that if p is prime and a is coprime to p, then ap-1 - 1 is divisible by p. This can also be written, ap-1 = 1 (mod p). It turns out that the converse of this theorem is usually true: if p is composite, then ap-1 is unlikely to be congruent to 1 mod p for an arbitrary value of a.

The encryption program PGP takes advantage of this property of the theorem to test whether the large random numbers it selects are prime. It tests the values we'll call x using 4 values of a (referred to as witnesses) using the above formula. These 4 values are 2, 3, 5 and 7, the first four primes. If 1 = 2x-1 = 3x-1 = 5x-1 = 7x-1 (mod x), it knows that the number x is probably prime. If any of the equations comes up with a value other than 1, then x is definitely composite. Using additional witnesses decreases the chance that a composite x will appear to be prime, although very few large numbers can fool the 4 witnesses already listed.

The pseudoprime article gives an in-depth discussion of numbers which fool primality tests such as these.

wikipedia.org dumped 2003-03-17 with terodump




 
 
158 carats gray AGATE gem Polished slab rectangle block Cabbing cab cabochon rough gemstone 31 grams
 158 carats gray AGATE Polished slab rectangle block Cabbing cab cabochon 31 grams 
 
30 gram picture MOONSTONE feldspar orthoclase gem Cab cabochon raw rough jewelry gemstone 154 carat
 30 gram picture MOONSTONE feldspar orthoclase Cab cabochon raw jewelry 154 carat 
 
15 carats yellow Oregon SUNSTONE gem stones Semi Facet cabbing rough gemstones lot Faceting jewels
 15 carats yellow Oregon SUNSTONE Semi cabbing lot ing jewels 
 
Red green AMMOLITE gem stone Freeform cabochon cabbing jewelry rough Ammonite opal 10 carats 2 grams
 Red green AMMOLITE Freeform cabochon cabbing jewelry Ammonite opal 10 carats 2 grams 
 
22 carat green new jade Serpentine rough gemstone tumble polished nugget drilled necklace bead Nice
 22 carat green new jade Serpentine tumble polished nugget drilled necklace bead Nice