CH4 Primitive roots Flashcards
EULERS THM recall
if gcd(a, n) = 1,
(coprime)
then aᵠ⁽ⁿ⁾ ≡ 1 (mod n).
for what values of k we have a^k ≡ 1 (mod n).
There may well be a smaller k such that ak ≡ 1 (mod n) (recall Exercise 2.2.5).
ϕ(n) can be the maximal power when n
is
a power of an odd prime and a few other cases.
Some of you may recognise that this happens precisely when (Z/nZ)× is a cyclic group
Definition 4.1.1
(Order)
Let a and n be coprime.
The order of a modulo n is the least d > 0 such that
(smallest positive integer d)
aᵈ ≡ 1 (mod n).
(how many powers to take to get to 1)
lagranges thm and order of an element
The order of an element always divides the sizes of group (Z/nZ)× . The size of this group is precisely ᵠ⁽ⁿ⁾
consequence of Lagranges thm in group theory
a=7 n =52
The order of 7 modulo 52?
The order of 7 modulo 52
(we could take all the powers up to and check)
We only need to consider
ϕ(52)=ϕ(4)ϕ(13)
= 2 x 12
=24
(or found by 52(1-1/2)(1-(1/13))
As the order of 7 divides 24 as 7^24 ≡ 1 (mod 52)).
So I only consider the powers of 7 that are divisors of 24:
1,2,4,8,3,6,8,12,24
7¹=7 (not the order of 7)
7²=49 ≡49≡-3 (mod 52)
7⁴= (49)²≡(-3)²=9 (mod 52)
7⁸=9²=81≡29 (mod 52)
7³= 7².7 = ≡(-3).7 =-21 ≡31 (mod 52)
7⁶=(7²)³≡(-3)³= -27 ≡25 (mod 52)
7¹²≡25²≡1 (mod 52)
7²⁴=
so d=12 is the order of 7 mod 52
E.g ϕ(12)
Example: For
n=12, only 1,5, 7, 11 are coprime with 12 so φ(12)=4
.
The prime factor decomposition 12
=2^2×3^1
formula
φ(12)=((2-1) x 2²⁻¹ ) x ((3-1) x 3¹⁻¹
)
= 2 x2 =4
φ(12)=
12(1- 1/2)(1- 1/3) = 12 x (1/2) x (2/3) = 4
How to calculate phi(n) if n is prime?
if n is a prime number, then
φ(n)=n−1
What are Euler’s totient properties?
The Euler indicator is an essential function of modular arithmetic:
— A positive integer p is a prime number IFF φ(p)=p−1
— The value φ(n)
is even for all n>2
— φ(ab)=φ(a)φ(b)dφ(d) with d the GCD of a and b
— If a and b are coprimes (relatively primes), then φ(a×b)=φ(a)×φ(b)
— If a divides b then φ(a)∣φ(b)
— If a is even, φ(2a)=2φ(a)
— If a is odd, φ(2a)=φ(a)
The sequence of values of Phi(n) is 1, 1, 2, 2, 4, 2, 6, 4, 6, 4, 10, 4, 12, 6, 8, 8, 16, 6, 18, 8, 12, 10, 22, 8, 20, 12, 18, 12, 28, etc.
Exercise 4.1.2. Suppose that n is coprime with 10 and that 10 has order d modulo n.
Show that the decimal expansion of 1/n
has period of length d.
In Exercise 2.2.5, we have used that the length of the period of 1/p is the
least d such that 10^d ≡ 1 (mod p). Let us repeat why, in a slightly different way:
recall that 10k
n has the decimal expansion of 1n
shifted to the left by k places. If we
divide 10k by n and write 10k = qkn + rk, with 0 ≤ rk < n, then
10^k / n= q_k + (r_k/n)
Since q_k is an integer and 0 ≤ r_k /n < 1, the first k digits of 1/n are the digits of the
integer q_k (shifted back by k places), and the remaining digits are the digits of r_k/n
(also shifted to the right by k places).
By construction, r_k is the remainder of 10^k by n, thus the least integer e such that the digits repeat themselves is the least e > 0 such that r_{k+e} = r_k, that is to say 10^{k+e} ≡ 10^k (mod n). This is the least e > 0 such that 10^e ≡ 1 (mod n), so e = d, as desired.
order d what can it be?
By Euler’s Theorem, d is at most ϕ(n), and in fact it divides ϕ(n) as we observed
in Exercise 2.2.5. Alternatively, Lagrange’s theorem says that d divides the size of
(Z/nZ)×, thus it divides ϕ(n).
Proposition 4.1.4.
Let a and n be coprime
gcd(a,n)=1
and let d be the order of a modulo n.
Then (for any power of a s.t)
aᵐ ≡ 1 (mod n)
IFF
Let a and n be coprime
gcd(a,n)=1
and let d be the order of a modulo n.
Then (for any power of a s.t)
aᵐ ≡ 1 (mod n)
IFF
d | m;
more generally,
(if we have two powers of a giving the same value)
aᶦ ≡ aʲ (mod n)
IFF
i ≡ j (mod d).
PROOF prop 1.4.1
Let a and n be coprime
gcd(a,n)=1
and let d be the order of a modulo n.
Then (for any power of a s.t)
aᵐ ≡ 1 (mod n)
IFF
d | m;
more generally,
(if we have two powers of a giving the same value)
aᶦ ≡ aʲ (mod n)
IFF
i ≡ j (mod d).
Suppose aᶦ ≡ aʲ (mod n).
WLOG i >j
(because a is coprime with m, we can divide by aʲ and still have coprime as gcd(a,n)=1)
aᶦ⁻ʲ≡ 1 (mod n)
Write
(i − j) = qd + r where 0 ≤ r < d.
(above by the division algorithm)
Then
(aᵈ)^q. aʳ
aᶦ⁻ʲ ≡ aʳ (mod n).
as aᵈ≡ 1 by defn of order
as aᶦ⁻ʲ≡ 1 (mod n)
by defn of order has to be the least possible powerso d |(i-j) so r=0
Since d is the order of a, we
find that aᶦ⁻ʲ≡ 1 if and only if r = 0, thus if and only if (i − j) ≡ 0 (mod d).
Example 4.1.5. If we know the order of 7 is 12 mod 52 what else?
The powers 7^1, 7^5, 7^7, 7^11 all have order 12 modulo 52
From the proposition
powers of 7 s.t the power is
7^12 is 1
multiplying 7^11 by 7 =7^12 ≡1
this is the multiplicative inverse of 7, multiplicative inverses preserve order
7 order 12 then
7^11 also has order 12
5+7=12 so when you multiply together they show they have same order as are inverses as =1
it happens they have the same order as 5,7 are coprime with 12
Suppose we have a,b coprime with n
and product
ab ≡1 mod n
then orders
gcd(a,n)=gcd(b,n)=1
order of a and b will be the same:
let d= order of a mod n
then
a^d ≡1 mod n
(ab)^d= a^d.b^d ≡1. b^d mod n
as ab ≡1
(ab)^d ≡1
thus
b^d ≡ 1 mod n
showing multiplicative inverses preserve order
extra
Extra. Computing the order of a modulo n is called Discrete Logarithm Problem. It is one of the several open problems in computational number theory and cryptography: as of today, no efficient algorithm is known (meaning that the number of steps required grows faster than any power of the number of binary digits of a). Solving the discrete logarithm problem efficiently would break certain cryptographic schemes.
Definition 4.1.6 (Primitive root)
An integer a is a primitive root modulo n or primitive root of n
if a is coprime to n and
it has order ϕ(n) modulo n.
(ie it is an element of the biggest possible order it could be;
the group (Z/nz)x is cyclic ;
if a is a primitive root if you take all of the powers of a up until phi(n) you generate all elements mod n)
In group theoretic terms, a is a primitive root of n when a generates the group (Z/nZ)×.
Thus primitive roots exist only when that group is cyclic.
by FlittleThm -euler a^(ph(n)) is always congruent to 1 mod n
Example 4.1.7. There are no primitive roots modulo 8.
dont always exist
n=8
coprime elements 1,3,5,7
orders of these
2:
1^1 ≡ 3^2 ≡ 5^2 ≡ 7^2 ≡ 1 (mod 8)
even though
ϕ(8) = 8(1 − 1/2)= 4.
none has order 4
shows x^2-1≡0 mod 8 has 4 roots