# Revision history [back]

The first example you gave is not cyclic, as seen e.g. by

sage: H.structure_description()
'Q8 : C27'


The meaning of this output can be found in GAP's manual for StructureDescription.

The second example (in your comment to tmonteil) is cyclic:

sage: G.<x0,x5> = FreeGroup()
sage: H = G/[x5*x0*x5*x0^-1*x5^-1*x0^-1, x0^-1*x5^-1*x0^-1*(x0^-1*x5^-3)^3*x0^-1*x5^-1]
sage: H.structure_description()
'C17'


In general, to find out if an element is a generator of a cyclic group you can take powers of it and see if you get the whole group. The difficulty here is that you need to put elements in a kind of normal form to compare them. Here you can do it with a confluent rewriting system:

sage: k = H.rewriting_system()
sage: k.make_confluent()
sage: H_reps = set([k.reduce(h) for h in H])
sage: next(h for h in H if set([k.reduce(h^m) for m in range(len(H))]) == H_reps)
x0


This shows x0 is a generator (the relation is x0^17 == 1).

I'm not a group theorist, but I would guess that for finite groups such a rewriting system always exists.

Note for cyclic groups of prime order, all non-identity elements are generators, and more generally in a cyclic group of order $n$, $\varphi(n)$ of the elements are generators.

The first example you gave is not cyclic, as seen e.g. by

sage: H.structure_description()
'Q8 : C27'


The meaning of this output can be found in GAP's manual for StructureDescription.

The second example (in your comment to tmonteil) is cyclic:

sage: G.<x0,x5> = FreeGroup()
sage: H = G/[x5*x0*x5*x0^-1*x5^-1*x0^-1, x0^-1*x5^-1*x0^-1*(x0^-1*x5^-3)^3*x0^-1*x5^-1]
sage: H.structure_description()
'C17'


In general, to find out if an element is a generator of a cyclic group you can take powers of it and see if you get the whole group. The difficulty here is that you need to put elements in a kind of normal form to compare them. Here you can do it with a confluent rewriting system:

sage: k = H.rewriting_system()
sage: k.make_confluent()
sage: H_reps = set([k.reduce(h) for h in H])
sage: next(h next((h for h in H if set([k.reduce(h^m) for m in range(len(H))]) == H_reps)
H_reps), None)
x0


This shows x0 is a generator (the generator; the relation is x0^17 == 1).. (Note there is room for optimization of this code, e.g. in calculating the powers.)

I'm not a group theorist, but I would guess that for finite groups such a rewriting system always exists.

Note for cyclic groups of prime order, all non-identity elements are generators, and more generally in a cyclic group of order $n$, $\varphi(n)$ of the elements are generators.