10.12.2012 Views

Prime Numbers

Prime Numbers

Prime Numbers

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

196 Chapter 4 PRIMALITY PROVING<br />

The next result begins to show a possible relevance of Gauss sums to<br />

primality testing. It may be viewed as an analogue to Fermat’s little theorem.<br />

Lemma 4.4.2. Suppose p, q, n are primes with p|q − 1 and gcd(pq, n) =1.<br />

Then<br />

G(p, q) np−1 −1 ≡ χp,q(n) (modn).<br />

Proof. Let χ = χp,q. Sincen is prime, the multinomial theorem implies that<br />

G(p, q) np−1<br />

=<br />

q−1<br />

<br />

m=1<br />

χ(m)ζ m q<br />

n p−1<br />

≡<br />

q−1<br />

m=1<br />

χ(m) np−1<br />

ζ mnp−1<br />

q (mod n).<br />

By Fermat’s little theorem, np−1 ≡ 1(modp), so that χ(m) np−1 = χ(m).<br />

Letting n−1 denote a multiplicative inverse of n modulo q, wehave<br />

q−1<br />

m=1<br />

χ(m) np−1<br />

ζ mnp−1<br />

q−1<br />

q = χ(m)ζ<br />

m=1<br />

mnp−1<br />

q =<br />

= χ(n)<br />

q−1<br />

m=1<br />

q−1<br />

m=1<br />

χ(mn p−1 )ζ mnp−1<br />

q<br />

χ(n −(p−1) )χ(mn p−1 )ζ mnp−1<br />

q<br />

= χ(n)G(p, q),<br />

where the next to last equality uses that χ(n p )=χ(n) p =1andthelast<br />

equality follows from the fact that mn p−1 traverses a reduced residue system<br />

(mod q) asm does this. Thus,<br />

G(p, q) np−1<br />

≡ χ(n)G(p, q) (modn).<br />

Let q −1 be a multiplicative inverse of q modulo n and multiply this last display<br />

by q −1 G(p, q). Lemma 4.4.1 then gives the desired result. ✷<br />

The next lemma allows one to replace a congruence with an equality, in<br />

some cases.<br />

Lemma 4.4.3. If m, n are natural numbers with m not divisible by n and<br />

ζ j m ≡ ζ k m (mod n), then ζ j m = ζ k m.<br />

Proof. By multiplying the congruence by ζ −k<br />

m , we may assume the given<br />

congruence is ζ j m ≡ 1(modn). Note that m−1<br />

l=1 (x − ζl m)=(x m − 1)/(x − 1),<br />

so that m−1<br />

l=1 (1−ζl m)=m. Thus no factor in this last product is zero modulo<br />

n, which proves the result. ✷<br />

Definition 4.4.4. Suppose p, q are distinct primes. If α ∈ Z[ζp,ζq] \{0},<br />

where α = p−2 q−2 i=0 k=0 aikζ i pζ k q , denote by c(α) the greatest common divisor<br />

of the coefficients aik. Further, let c(0) = 0.<br />

We are now ready to describe the deterministic Gauss sums primality test.<br />

Algorithm 4.4.5 (Gauss sums primality test). We are given an integer n><br />

1. This deterministic algorithm decides whether n is prime or composite, returning<br />

“n is prime” or “n is composite” in the appropriate case.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!