How to find a generator of a cyclic group? A cyclic group is a group that is generated by a single element.  That means that there exists an element $g$, say, such that every other element of the group can be written as a power of $g$.  This element $g$ is the generator of the group.
Is that a correct explanation for what a cyclic group and a generator are? How can we find the generator of a cyclic group and how can we say how many generators should there be?
 A: 1.) For large group orders it is no suitable to explicitly evaluate all powers of an optional generator to prove the element's order.
2.) The fact that a multiplicative cyclic finite group is isomorphic to some additive finite subgroup in ℤ is not helpful, as the isomorphism is defined exactly by a generator.
Criterion: An element $g$ of multiplicative group of order $(p-1)$ in $ℤ/pℤ$  with prime $p$ is a generator, iff for each prime factor $q$ in the factorization of $p-1$
     g^((p-1)/q) <> 1

holds.
This excludes $g$ from being generator of a real subgroup and
reduces the problem to factorization of $p-1$.
A: Finding generators of a cyclic group depends upon the order of the group. If the order of a group is $8$ then the total number of generators of group $G$ is equal to positive integers less than $8$ and co-prime to $8$.
The numbers $1$, $3$, $5$, $7$ are less than 8 and co-prime to $8$, therefore if a is the generator of $G$, then $a^3,a^5,a^7$ are also generators of $G.$
Hence there are four generators of $G.$ Similarly you can find generators of groups of order $10$, $12$, $6$ etc.
A: Every cyclic group is isomorphic to either $\mathbb{Z}$ or $\mathbb{Z}/n\mathbb{Z}$ if it is infinite or finite. If it is infinite, it'll have generators $\pm1$. If it is finite of order $n$, any element of the group with order relatively prime to $n$ is a generator. The number of relatively prime numbers can be computed via the Euler Phi Function $\phi(n)$.
Thus for an arbitrary group $G$, you can define an isomorphism to  $\mathbb{Z}$ or $\mathbb{Z}/n\mathbb{Z}$ and those elements that map to the generators of  $\mathbb{Z}$ or $\mathbb{Z}/n\mathbb{Z}$ are the generators of $G$. That is, the orders of the elements in $G$ must be relatively prime to the degree of $G$ for them to be a generator.
A: Your explanation sounds good to me.
In the general case, finding the generator of a cyclic group is difficult. For example, I believe there is no fast algorithm to find a generator for the multiplicative group $(\mathbb Z/p^k\mathbb Z)^\times$ when $p$ is a large prime. But much of the time when you work with a cyclic group you will also naturally know of a generator.
If your cyclic group has order $n$, I claim that there will be one generator for every number between $1$ and $n-1$ (inclusive) that is relatively prime to $n$: in other words, there are $\varphi(n)$ generators, where $\varphi$ is Euler's totient function. Why is my claim correct? Suppose $g$ is a generator for the group, so that $g$ has order $n$. It is a fact, which I encourage you to prove if you have not encountered it, that for an integer $m$ between $1$ and $n$ the order of $g^m$ is $n/(m,n)$, where $(m,n)$ is the greatest common denominator of $m$ and $n$. So for $g^m$ to be a generator -- or equivalently, for $g$ to have order $n$ -- it is both necessary and sufficient that $m$ be relatively prime to $n$. And every element of the group has the form $g^m$ for some $m$. Hence there are $\varphi(n)$ generators.
If your cyclic group has infinite order then it is isomorphic to $\mathbb Z$ and has only two generators, the isomorphic images of $+1$ and $-1$. But every other element of an infinite cyclic group, except for $0$, is a generator of a proper subgroup which is again isomorphic to $\mathbb Z$.
A: Your explanation is correct.  If the group is finite, then there is some order to $g$, i.e. $g^n=e$, and $n$ is minimal.  Then $g^m$ is a generator, for each $m$ that satisfies $\gcd(m,n)=1$.  Hence there are $\phi(n)$ generators, where $\phi$ denotes the Euler totient.  Generally there are lots of generators, so it's not that hard to find one.  Just take random elements and compute their orders.
A: I list computational methods in group theory. The $C_8$ example by Sharma is visualised in Mathematica below. Python one-liners are convenient way to verify generator guesses, in the case of multilpicative group just change one $*$ (multiplication) to $**$ (power).
Python
For example to check that 1 and 5 generate $(\mathbb Z_6,+)$ and all relative prime numbers $\{1,3,5,7\}$ generate $(\mathbb Z_8,+)$
>>> [(1*x)%6 for x in range(20)]
[0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1]
>>> [(5*x)%6 for x in range(20)]
[0, 5, 4, 3, 2, 1, 0, 5, 4, 3, 2, 1, 0, 5, 4, 3, 2, 1, 0, 5]

>>> [(3*x)%8 for x in range(20)]
[0, 3, 6, 1, 4, 7, 2, 5, 0, 3, 6, 1, 4, 7, 2, 5, 0, 3, 6, 1]
>>> [(5*x)%8 for x in range(20)]
[0, 5, 2, 7, 4, 1, 6, 3, 0, 5, 2, 7, 4, 1, 6, 3, 0, 5, 2, 7]
>>> [(7*x)%8 for x in range(20)]
[0, 7, 6, 5, 4, 3, 2, 1, 0, 7, 6, 5, 4, 3, 2, 1, 0, 7, 6, 5]

Mathematica (source)
On Sharma's example: the $C_8$ isomorphic to $(\mathbb Z_8,+)$ group visualised below.





Other and discussion


*

*CAS programs for the first course in abstract algebra?


*https://math.stackexchange.com/questions/1653673/software-for-generators-of-different-structures-such-mathbb-z-5-and-such-as


*How to declare a $(\mathbb Z_8,+)$ in Mathematica?


*Maple has Generators(group) command but you need to specify the group somehow, unsolved.

A: Yes, your explanation is fine. Let $G$ be your cyclic group. 


*

*If $G$ is infinite, then $G\cong \mathbb Z$, which has two generators, $\pm \,1$.

*If $G$ is finite, of order $n$, then $G\cong \mathbb Z/n\mathbb Z$. If you have a generator $g\in G$ (for instance: the image of the class of $1$ under an isomorphism $\mathbb Z/n\mathbb Z\to G$), then $g^i\in G$ is a generator if and only if $(n,i)=1$. Hence there are exactly $\phi(n)$ generators in a finite cyclic group.

A: That sounds right. The number of generators depends on the order of the group. The infinite cyclic group $\mathbb{Z}$ has two generators, $\pm 1$. A finite cyclic group of order $k$ has $\phi(k)$ generators where $\phi$ is the Euler phi function.
A: In the case of finite cyclic groups, once you have a generator,  finding others hinges on the fact that $|g^k|=n/(n,k)$, for $g$ of order $n$.
Here's a proof of that important fact.
Proof:
$(g^k)^{n/(n,k)}=g^{nk/(n,k)}=(g^n)^{k/(n,k)}=e^{k/(n,k)}=e$.
Thus $|g^k|\le n/(n,k)$.
So suppose $|g^k|=l$.  Then $g^{kl}=e\implies n\mid kl$  (this fact follows easily by an application of the division algorithm). So $kl=mn$. So $kl\ge\rm{lcm}(n,k)$.
Thus $l\ge\rm{lcm}(n,k)/k=n/(n,k)$.
Edit of course there's still the issue of finding a first generator.  You can try random elements.   But there's no general method for finding generators $\pmod p$.  Nor more generally (if they exist) $\pmod n$.  It is known that a primitive exists precisely when $n=1,2,4,p^\alpha $ or $2p^\alpha $.  Gauß knew it.
