Let $H$ be the subgroup of Rubik's cube moves generated by a half-turn of the downward face and a half-turn of the rightmost face. What is $|H|$? I was going through Janet Chen's "Group Theory and the Rubik's Cube" (PDF), and I came across this question: 

Let $D$ denote a clockwise quarter turn on the downward face and $R$ denote a quarter turn on the rightmost face clockwise (We have the 6 faces: front (facing us), back, down, up, left, right.) Let $\mathbb{G}$ be the group formed by all possible moves on the Rubik's cube. Let $H$ be the subgroup of $\mathbb{G}$ generated by $D^2$, $R^2$. (Here, $D^2$ is taken as the composition of two $D$ moves.) Find the number of elements of $H$.

I have listed out $D^2$, $R^2$ in disjoint cycle notation but I am stuck. 
Would appreciate if anyone could help, thanks.
 A: $H$ is generated by $d=D^2$ and $r=R^2$. We have that $d^2=r^2=e$ is the identity, so each element of $H$ may be written on one of four forms:
$$
drdr\cdots dr\\
rdrd\cdots rd\\
drdr\cdots rd\\
rdrd\cdots dr
$$
($d$ itself is of the third form, and $r$ of the fourth.)
At some point, repeating $rd$ takes you back to the identity.  This puts a limit to how long these chains can be.
Finally, note that some of the chains described above, even below the "identity length", are equal. For instance, the chain $drdr\cdots rd$ that is only one $r$ short of being the identity, is actually equal to the chain $r$ (by virtue of $r=r^{-1}$).
Taking all this into account, you will have found $|H|$.
A: I solved this using GAP (tag added):
gap> d := (1,3)(2,4);; r := (1,5)(2,6);;
gap> H := Group(d,r);;
gap> StructureDescription(H);
"S3"

So H is the symmetric group on three elements. How are these permutations obtained?
gap> epi := EpimorphismFromFreeGroup(H);
[ x1, x2 ] -> [ (1,3)(2,4), (1,5)(2,6) ]
gap> List(H, h->[h,PreImagesRepresentative(epi,h)]);
[ [ (), <identity ...> ], [ (3,5)(4,6), x1^-1*x2^-1*x1^-1 ],
[ (1,3,5)(2,4,6), x1^-1*x2^-1*x1^-2 ], [ (1,3)(2,4), x1^-1 ],    
[ (1,5,3)(2,6,4), (x1^-1*x2^-1)^2 ], [ (1,5)(2,6), x2^-1 ] ]

Can I express this group using a finite presentation?
gap> iso := IsomorphismFpGroup(H);
[ (3,5)(4,6), (1,5,3)(2,6,4) ] -> [ F1, F2 ]
gap> pr := PresentationFpGroup(Image(iso));
<presentation with 2 gens and 3 rels of total length 10>
gap> TzPrintRelators(pr);
#I  1. F1^2
#I  2. F1^-1*F2*F1*F2^-2
#I  3. F2^3
gap> TzGoGo(pr);
#I  there are 2 generators and 3 relators of total length 9
gap> TzPrintRelators(pr);
#I  1. F1^2
#I  2. F2^3
#I  3. (F1*F2)^2

