1

I am trying to understand how to find a generator of Zp. How to find generator $g$ in a cyclic group?.
I have heard that we can pick random a Zp and for each primitive d| p-1 check wether:
a^[(p-1)/d] != 1 .If it holds it is a generator, otherwise it is not.

Why does this hold? If a is of order q | p-1 then all I can see is that from Fermat's theorem:
a^(p-1) = a^(q* p-1/q) = 1 mod p

tonythestark
  • 173
  • 6

1 Answers1

4

By Lagrange’s theorem, the order of g must divide p-1. Thus, if the order of g is not any other factor of p-1 besides p-1. The order of g must be p-1.

Wilson
  • 959
  • 6
  • 10