Module 8 : Primality Testing

Lecture 1 : Primality Testing

 

Properties:

 

Before going into any of the primality tests we give a basic principle on which the tests depend upon.

Basic principle: let n be an integer and suppose there exist integers x and y with x2≡y2 (mod n), but x ≢ ±y ( mod n). Then n is composite. Morover, gcd(x-y,n) gives a nontrivial factor of n. 

Proof: Let d = gcd(x-y, n). if d= n then x ≡ y ( mod n), which is assumed not to happen. Suppose   d=1. A basic result on divisibility is that if a| bc and gcd(a,b) =1, then a |c.In our case, since n divides x2– y2 = (x-y) (x+y) and d=1, we must have that n divides x+y, which contradicts the assumption that x ≢ -y (mod n). Therefore d ≠ 1, n so d is nontrivial factor of n.