Download 2.7 Lecture 7

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Sieve of Eratosthenes wikipedia , lookup

Mersenne prime wikipedia , lookup

Elliptic curve primality wikipedia , lookup

Wieferich prime wikipedia , lookup

Prime number theorem wikipedia , lookup

List of prime numbers wikipedia , lookup

Transcript
MODULE 2. CONGRUENCE
2.7
Lecture 7
Lecture 7
Preamble: In this lecture, we will introduce pseudo-primes. A pseudo-prime is actually
a composite number, but it has certain properties which prime numbers have.
Keywords: pseudo-primes, Carmichael numbers
2.7.1
Pseudo-primes
Prime numbers are the building blocks for integers. It is of considerable interest to
know whether a given integer is prime or not. The process of testing whether a given
natural number is prime or not is called primality testing. While Wilson’s theorem and
its converse give a characterization for a number to be prime, it is not a very effective
way as one has to compute (n − 1)! modulo n. Hence there is a need for developing other
tests. We will discuss various primality tests in section 10.1 after we develop the theory
needed for those tests. By corollary to Fermat’s little theorem in the previous lecture,
we have seen that for any prime number p, we must have
ap ≡ a mod p.
So given an integer n, if
an ≡ a mod n
for some natural number a, we can immediately conclude that n is not prime. For computation, it is easiest to try a = 2. If 2n ≡ 2 mod n, then n fails this primality test
with 2 as base, and we can immediately conclude that n is composite. For example,
26 = 64 ≡ 2 mod 6, hence 6 fails the test, and hence 6 has to be composite. However,
even if n passes the test, it may still be composite.
For example, consider the composite number n = 341 = 11 · 31. We will show that
2341 ≡ 2 mod 341.
By Fermat’s Little Theorem (theorem 2.16 of lecture 6), we have
210 ≡ 1 mod 11,
=⇒
2340 ≡ 1 mod 11
=⇒
2341 ≡ 2 mod 11
48
MODULE 2. CONGRUENCE
Lecture 7
and
230 ≡ 1 mod 31
=⇒
2330 ≡ 1 mod 31
=⇒ 2341 ≡ 211 mod 31
≡ (25 )2 · 2 mod 31
≡ 2 mod 31.
Thus, 2341 − 2 is divisible by both 11 and 31, and hence by 11.31 = 341, and
2341 ≡ 2 mod 341.
DEFINITION 2.19. A composite number n such that
2n ≡ 2 mod n.
is called a pseduo-prime, or more precisely, pseudo-prime to the base 2.
From the above example, 341 is a pseudo-prime. In fact, it is the smallest pseudo-prime.
There are infinitely many pseudo-primes, which we can deduce from the following proposition.
PROPOSITION 2.20. If n is a pseudo-prime, then so is 2n − 1.
Proof: We have 2n ≡ 2 mod n, so we can write 2n = 2 + nk for some positive integer k.
Then,
2n − 1 = 1 + nk
=⇒ 22
n −1
= 21+nk = 2 · (2n )k
= 2 · (2n − 1 + 1)k
≡ 2 · (1)k mod (2n − 1)
≡ 2 mod (2n − 1).
Now it is enough to show that 2n − 1 is composite when n is composite. Let n = rs,
where r, s > 1. Then
2rs − 1 = (2r − 1)[(2r )s−1 + (2r )s−1 + · · · + (2r )s−1 + 1].
For r > 1, the factor (2r − 1) > 1, and for s > 1, the factor
(2r )s−1 + (2r )s−1 + · · · + (2r )s−1 + 1 > 1.
Thus, 2rs − 1 must be composite for r > 1 and s > 1.
49
MODULE 2. CONGRUENCE
2.7.2
Lecture 7
Carmichael Numbers
By corollary to Fermat’s little theorem in the previous lecture, we have seen that for
any prime number p, we have
ap ≡ a mod p.
If a natural number n passes the pseudo-prime test, i.e., 2n ≡ 2 mod n, n may still be
composite. So we can check whether 3n ≡ 3 mod n. If n fails the test with base 3, then
one can immediately conclude that n is composite. For example 341 is composite, for it
fails the primality test with base 3:
3341 ≡ (330 )11 · 311 mod 31
≡ 111 · (33 )3 · 32 mod 31
≡ (−4)3 · 9 mod 31
≡ (−2) · 9 mod 31
≡ 3 mod 31
=⇒ 3341 ≡ 3 mod (31 · 11 = 341).
But if n passes the test with base 3, we should check with another base, till we exhaust
all the bases from 2 to (n − 1). In fact, once n passes the test for bases a and b, it
will also pass the test for the base ab, so one need not actually check all the bases 2 to
(n − 1). If n fails the test for some base, we can conclude that n is composite. However,
it may happen that n passes the test for all bases from 2 to n − 1, but still be composite.
Such an integer is called a Carmichael number.
DEFINITION 2.21. A composite number n such that
an ≡ a mod n
for any integer a is called a Carmichael number.
Example: 561 is a Carmichael number.
It is clearly composite, as 561 = 3 · 11 · 17. Let a be any integer. We will show that
a561 ≡ a modulo 3, 11 and 17. If a is divisible by 3 (or by 11 or 17 respectively), it
trivially follows that a561 ≡ a mod 3 (or mod 11 or 17 respectively). If a is co-prime to
3, we have
a2 ≡ 1 mod 3 =⇒ a560 ≡ (a2 )280 ≡ 1 mod 3 =⇒ a561 ≡ a mod 3.
50
MODULE 2. CONGRUENCE
Lecture 7
Similarly, if a is coprime to 11, we have
a10 ≡ 1 mod 11 =⇒ a560 ≡ (a10 )56 ≡ 1 mod 11 =⇒ a561 ≡ a mod 11.
Similarly, if a is coprime to 17, we have
a16 ≡ 1 mod 17 =⇒ a560 ≡ (a16 )35 ≡ 1 mod 17 =⇒ a561 ≡ a mod 17.
One can show that there are no Carmichael numbers smaller than 561. Carmichael conjectured in 1912 that there are infinitely many Carmichael numbers. It was proved in
1992 by Alford, Granville and Pomerance.
PROPOSITION 2.22. A square-free number n is either prime or a Carmichael number
if p − 1 divides n − 1 for every prime divisor p of n.
Proof: Suppose
n = p 1 · p 2 · · · · · pr ,
where pi ’s are distinct primes and pi − 1 divides n − 1 for each i. We need to show that
an ≡ a mod pi for each i = 1, 2, . . . , r. This congruence follows trivially if a is divisible
by pi . If ai is coprime to pi , we have
api −1 ≡ 1 mod pi
=⇒ an−1 ≡ 1 mod pi
=⇒ an ≡ a mod pi
=⇒ an ≡ a mod p1 · · · · · pr .
For the Carmichael number 561 that we demonstrated earlier, we find that 560 is divisible
by 3 − 1, 11 − 1 and 17 − 1.
51