TITLE: Semidirect product of two cyclic groups
QUESTION [14 upvotes]: Describe all semidirect products of $C_n$ by $C_m$ (ie $C_n \rtimes C_m$) where $m,n \in \mathbb{N_+}$  

Note: For the first attempt one needs to find all homomorphisms from $C_m \to U(n)$, but the situation differs a lot for different pairs of $n ,m$, is there a better way to find all structures of $C_n \rtimes C_m$?
Wikipedia provided a general presentation of this product which I do not know how it was worked out.

REPLY [3 votes]: As any automorphism of $C_n$ is of the form $g \mapsto g^k$ for some $k$, such that $GCD(n, k) = 1$, we have any semidirect product $C_n \rtimes C_m$ being of the form $\langle a, b|a^n = e, b^m = e, b^{-1}ab = a^k\rangle$. From that presentation we get, that $a = b^{-m}ab^{m} = a^{k^m}$. Thus, $ord(a) = n$ iff $n|k^m - 1$. 
So any such semidirect product is defined by presentation $\langle a, b|a^n = e, b^m = e, b^{-1}ab = a^k\rangle$, where $n|k^m - 1$