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
  • You are actually trying to find a generator of the multiplicative subgroup $\mathbb Z_p^$ of $\mathbb Z_p$ aka $\mathbb Z/p\mathbb Z$. The $$ denotes exclusion of element(s) without multiplicative inverse, and the use of multiplication as the group law. – fgrieu Jan 30 '23 at 11:00

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
  • 929
  • 6
  • 9
  • that's true, but if I understand well you suggest just checking for all d | p-1 that g^d !=1, but I wonder why some people suggest checking g^{p-1/d} – tonythestark Jan 29 '23 at 07:46
  • 2
    It's an equivalent statement that you should prove for yourself. Here's an example to get you started. Consider p = 11, p-1 = 10 = 5*2. Notice how g^{10/5}= g^2, g^{10/2} = g^5. Thus, testing g^d for all d | p-1, is the same as testing g^{(p-1)/d}. – Wilson Jan 29 '23 at 17:58
  • Here is my new effort: If $ord(a)=d \implies a^d=1 \mod p$ then since $(a^{(p-1)/d})^d=1$ the order of $b=a^{p-1/d}$ must divide d . Assume $p-1/d = k \in N$ then $a^k$ must belong in the subgroup of a.. how can I go on? – tonythestark Feb 02 '23 at 18:27
  • Let $D$ be the set of divisors of p-1 except for 1. Consider the set $C= {(p-1)/d \mid d \in D}$. Why does this set $C$ contain all divisors of p-1 except p-1? – Wilson Feb 04 '23 at 04:33