primitive elements

Upload: syed-jibran-uddin

Post on 07-Apr-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/3/2019 Primitive Elements

    1/2

    Primitive Roots mod p

    Fermats Little Theorem tells us that a p1 1 (mod p) if p is primea / 0 (mod p). Let us look at some examples

    p = 5 p = 7 p = 13 p = 23

    a = 2 a = 2 a = 3 a = 2 a = 3 a = 2 a = 3 a = 5

    20 1 2 0 1 3 0 1 2 0 1 3 0 1 2 0 1 3 0 1 5 0 1

    21 2 2 1 2 3 1 3 2 1 2 3 1 3 2 1 2 3 1 3 5 1 522 4 2 2 4 3 2 2 2 2 4 3 2 9 2 2 4 3 2 9 5 2 223 3 2 3 1 3 3 6 2 3 8 3 3 1 2 3 8 3 3 4 5 3 1024 1 2 4 2 3 4 4 2 4 3 3 4 3 2 4 16 3 4 12 5 4 4

    25 4 3 5 5 2 5 6 3 5 9 2 5 9 3 5 13 5 5 2026 1 3 6 1 2 6 12 3 6 1 2 6 18 3 6 16 5 6 8

    27 11 3 7 3 2 7 13 3 7 2 5 7 17

    28

    9 38

    9 28

    3 38

    6 58

    1629 5 3 9 1 2 9 6 3 9 18 5 9 11210 10 3 10 3 2 10 12 3 10 8 5 10 9211 7 3 11 9 2 11 1 3 11 1 5 11 22212 1 3 12 1 2 12 2 3 12 3 5 12 18

    213 4 3 13 9 5 13 21214 8 3 14 4 5 14 13215 16 3 15 12 5 15 19216 9 3 16 13 5 16 3217 18 3 17 16 5 17 15218 13 3 18 2 5 18 6219 3 3 19 6 5 19 7220 6 3 20 18 5 20 12221 12 3 21 8 5 21 14222 1 3 22 1 5 22 1

    Some observations on the table.

    1) In all cases, a p1 1 (mod p). We already knew this had to occur, byFermats Theorem.

    2) For each prime p in the table, we can find some integer b (notdivisible by p) such that b i / 1 (mod p) for 0 < i < p1. In other words, p1 is the smallest positive integer j such that b j 1 (mod p).

    We call b a primitive root mod p.

    2 is a primitive root mod 5, and also mod 13.3 is a primitive root mod 7.5 is a primitive root mod 23.

    It can be proven that there exists a primitive root mod p for every prime p. (However, the proof isnt easy; we shall omit it here.)

    3) For each primitive root b in the table, b0, b1, b2, ..., b p2 are alldistinct in Z p, and they constituted all the nonzero elements of Z p.

    Again, this is always true, and easy to prove. We know that b has an inverse since b / 0 (mod p). If

    bi bk (mod p) for 0 i < k p2,

    thenbi (b1)i bk (b1)i bi bi bk bi 1 b k i (mod p)

    and 0 < k i k p2, which contradicts b being primitive.

  • 8/3/2019 Primitive Elements

    2/2

    4) For each prime in the table, we can find nonzero integers a that arenot primitive roots mod p. In each case, if k is the smallest positiveinteger with a k 1 (mod p), then k divides p1.

    Once more, this always holds, and is easy to show. If it k doesnot divide p1, write p 1 = qk + r , with 1 r < k . (r 0 sincek does not divide p1.) Then

    a p 1 a qk + r a p 1 (a k )q a r 1 1qa r a r 1 (mod p)

    which contradicts k being the smallest positive integer witha k 1 (mod p).

    The smallest positive integer k with a k 1 (mod p) is called theorder of a mod p. I will write the order of a as o( a). (Recall itdepends on p).

    We have shown that o( a) divides p1 for all a / 0 (mod p). Note

    a is a primitive root if and only if o( a) = p1.

    5) In the table, whenever b is a primitive element mod p, then everyinteger x with x / 0 (mod p) is a power of b, i.e., x bk for someinteger k .

    Again, this is true in general, and follows immediately from (3).

    However, given x, we have no practical way to find k , assuming p is large.

    Computing k involves finding a discrete logarithm, and findingdiscrete logarithms with a large prime base is (as far as anyoneknows) too difficult to be practical. (Much of public keycryptography would collapse if an efficient algorithm for discrete logs were discovered.)

    6) If b is a primitive root mod p, then o( bk ) = ( p 1) / gcd( p 1, k ).

    Let d = gcd ( p1, k ), p 1 = ud

    k = vd .

    If ( b k )m 1, then b km 1, so ( p 1) | km and ( p 1)/ d | (k /d )m.

    Since ( p 1)/d and k /d are relatively prime, we conclude( p 1)/d | m. In other words, ( p 1)/ gcd( p 1, k ) divides m. In

    particular, ( p 1) / gcd( p 1, k ) divides o( bk ).

    (bk )( p 1)/ d (bvd )( p 1)/ d b( p 1) v 1 (mod p), so o( bk ) divides( p 1)/d = ( p 1)/ gcd( p 1, k ).

    So o( bk ) = ( p 1) / gcd( p 1, k ).

    7) If b is any primitive root mod p, then the set of all primitive rootsmod p is exactly {bk | gcd( p 1, k ) = 1 }. The number of primitiveroots mod p is ( p1).

    For example, consider the case p = 13 in the table.

    ( p1) = (12) = (223) = 12(1 1/2)(1 1/3) = 4.

    If b is a primitive root mod 13, then the complete set of primitiveroots is { b1, b5, b7, b11}. We see from the table that 2 is a

    primitive root mod 13.. The complete set of primitive roots mod13 is {2 1, 25, 2 7, 211} = {2, 6, 11, 7}.