Fermat and Euler Theorem
Fermat and Euler Theorem
a p-1 ≡ (1 mod p)
Proof:
Consider a set of positive integers less than p:{1,2,3…..p-1} and multiply each element by
a mod p, to get a set X={a mod p,2a modp,3a mod p,……(p-1)a modp}
Because a is relatively prime to p, we can eliminate a from both sides, resulting in j ≡ k (mod p)
This last equality is impossible, because j and k are both positive integers less than p.
Therefore we know that the p-1 elements of X are all positive integers with no two elements equal.
We can conclude the X consists of the set of integers :{1,2,3…..p-1}in some order.
Multiplying the numbers in both sets (p and X) and take the results mod p yield
a x 2a x 3a……(p-1)a ≡ [(1x2x3……(p-1)](mod p)
a p-1 ≡ (1 mod p)
Eg: a= 7, p = 19
a p-1 ≡ (1 mod p)
7 19-1 =718
a p ≡ (a mod p)
eg: p=5,a=3
a p =35 =243 mod 5 =3
Euler’s totient function is represented as Φ(n),the number of positive integers less than n and
relatively prime to n. Φ(n)=1.
Φ(n) = n-1
Φ(1) = 1
Φ(2) = 1
Φ(3)= {1,2}=2
Φ(4) = {1 ,3}=2
Φ(5) = {1,2,3,4}=4
Φ(6) = {1 ,5} =2
Φ(7) = {1,2,3,4,5,6} =6
Φ(8) = {1,3,5,7} =4
Φ(11) = {1,2,3,4,5,6,7,8,9,10}=10
Φ(13) ={1,2,3,4,5,6,7,8,9,10,11,12}=12
Euler‘s Theorem
• Euler’s theorem states that for every a and n that are relatively prime:
aΦ(n) ≡ 1(mod n) 1
Proof:
Eq.1 is true if n is prime, because in that case, Φ(n) = n-1 and Fermat’s theorem holds. However it
also holds for any integer n. Recall that Φ(n) is the number of positive integers less than n that are
relatively prime to n.
That is,each element xi of R is a Unique positive integer less than n with gcd(xi, n)=1.
Now Multiply each element by a modulo n:
1.Because a is relatively prime to n and xi is relatively prime to n, axi must also be relatively prime
to n.Thus all the members of S are integers that are less than n and that are relatively prime to n
Therefore,
aΦ(n) ≡ 1(mod n)
eg: a= 3;n=10
a Φ(n) ≡ 1(mod n)
3 Φ(n) =3 Φ(10)
Φ(10)
={1, 3, 7, 9}
=4
3 4 = 81 mod 10 =1