Pseudo Primes and Carmichael Numbers
In theory, Wilson’s Theorem solves the primality-testing problem.However, the difficulty of computing factorials makes it a very inefficient test, even for fairly small integers. In many cases we can do better by using Fermat's little Theorem, or rather its contra positive, which asserts that if there is an integer a satisfying an≢a(modn), then n is composite. This test is much easier to apply, since in modular arithmetic, large powers can be calculated much more easily than factorials. This is particularly true if a computer, or even a calculator, is available. Although we will restrict attention to examples which are small enough to deal with by hand, it is a good exercise to write programs to extend the techniques to much larger integers.
The method is as follows. If we are given an integer n to test for primality, we choose an integer a and compute an(modn), reducing the numbers mod(n) whenever possible to simplify the calculations. Let us say that n passes the base a test if an≡a(modn), and fails the test if an≢a(modn); thus if n fails the test for any a then it implies that n must be composite, whereas if n passes the test then it might be prime or composite. For computational simplicity, it is sensible to start with a=2 (clearly a=1 is useless). If we find that 2n≢2(modn), then n has failed the base 2 test and must therefore be composite, so we can stop.
For instance, 26≡64≢2(mod6), so 6 fails the test and is therefore composite. The Chinese knew this test, and they conjectured 25 centuries ago that the converse was also true, that if n passes the base 2 test then n is prime. This turns out to be false, but it took until 1819 for a counterexample to be discovered: there are composite integers n satisfying 2n≡2(modn), so they pass the base 2 test and yet they are not prime. We call such integers pseudoprimes: they look as if they are prime numbers, but they are in fact composite.
Example:Let's apply the base 2 test to the integer n=341
Computing 2341(mod341) is greatly simplified by noting that 210=1024≡1(mod341), so
2341=(210)34.2≡2(mod341)
and 341 has passed the test. However 341=11×31, so it is not a prime but a pseudo-prime. (In fact, knowing this factorisation in advance, one could ‘cheat’ in the base 2 test to avoid large computations: since 11 and 31 are primes, 210≡1(mod11) and 230≡1(mod31), which easily imply that 2341−2 is divisible by both 11 and 31, and hence by 341.) By checking that all composite numbers n<341 fail the base 2 test, one can show that 341 is the smallest pseudo-prime.
Fortunately, pseudo-primes are quite rare, but nevertheless, there are infinitely many of them.
Mersenne Numbers Mp=2p−1( p prime) and Fermat Numbers Fn=22n+1(n≥0) all pass the base 2 test.
Let us return to our primality-testing method. If n fails the base 2 test then we can stop, knowing that n is composite; however, if n passes then it could be prime or pseudo-prime, and we do not know which. We therefore repeat the test. with a different value of a. As with a=2, failing the test shows that n is composite, whereas passing tells us nothing.
In general, we test n repeatedly, each time using a different value of a. Note that if n has passed the tests for bases a and b (possibly equal), so that an≡a(modn) and bn≡b(modn), then (ab)n≡anbn≡ab(modn), so n must also pass the base ab test; there is therefore no point in applying this test, and it is sensible to restrict the values of a to successive prime numbers. We call n a pseudo-prime to the base a if n is composite and satisfies an≡a(modn); thus a pseudo-prime to the base 2 is just a pseudo-prime, as defined earlier.
If we consider 341 it is passed the base 2 test.If we consider 3.Then 3341≢3(mod341).ie; 341 fails the base 3 test.
The smallest example of a Carmichael number is n=561=3.11.17. This is clearly composite, so to show that it is a Carmichael number we need to show that a561≡a(mod561) for all integers a, and to do this it is sufficient to show that the congruence a561≡a is satisfied modulo 3,11 and 17 for all a.
Comments
Post a Comment