Sunday, January 20, 2013
Ex 2.26 Z∗19 and multiplicative order 18
Find all elements of Z∗19 of multiplicative order 18.
== Attempt ==
Since 19 is a prime number, φ(19)=19−1=18. Using Euler's theorem, we know that αφ(19)=α18=1 for α∈Z∗19.
(For a given positive integer n, we say that a∈Z with gcd(a,n)=1 is a primitive root modulo n if the multiplicative order of a modulo n is equal to φ(n). Since the multiplicative order 18 is equal to φ(19), this exercise is equivalent to finding the primitive roots modulo 19.)
Note that if αk=1 with k<18, k must divide 18. Since the multiplicative order of 1 is always limited to 1, we only need to check k that divides 18 except 1:
== Python ==
== Output ==n = 19 ks = [2,3,6,9] # k that divides 18 except 1 output = [] for i in xrange(2,n): primitive_root = True for k in ks: e = i**k if e - e/n*n == 1: primitive_root = False break; # multiplicative order less than 18 if primitive_root: output.append(i) print 'Elements with multiplicative order 18:', output
Elements with multiplicative order 18: [2, 3, 10, 13, 14, 15]