how many semi direct products are there? This question was initially proposed to me by two friends. Given an integer $n$, how many isomorphism classes are there for semidirect products $\mathbb{Z}/n\mathbb{Z}\rtimes\mathbb{Z}/2\mathbb{Z}$?
Maybe this is a really trivial question. I can tell that a semidirect product is the same as an integer $r\in\mathbb{Z}/n\mathbb{Z}$ with $r^2=1\mod[n]$, but are there isomorphisms between some of them? What happens for instance when n is squarefree, thus the product of fields.
 A: You are asking for isomorphism classes of split extensions $H$ of the module $N:=\mathbb{Z}/n\mathbb{Z}$ by the group $G:=\mathbb{Z}/2\mathbb{Z}$. This is a special case of a metacyclic group, by the way.
A first approximation is to determine all homomorphisms from $\mathbb{Z}/2\mathbb{Z}$ into the automorphism group $Aut(N)$ of $N$; each of these corresponds to a semidirect product (but we still might get some isomorphism classes multiple times). Now, it is well-known that $Aut(N)\cong \mathbb{Z}/\phi(n)\mathbb{Z}$, where $\phi$ denotes Euler's totient function.
Using the above (and the links I gave), it is not difficult to see that the 2-Sylow-subgroup $P$ of $Aut(N)$ is isomorphic to $(\mathbb{Z}/2\mathbb{Z})^m \times Aut(\mathbb{Z}/2^k\mathbb{Z})$, where $m$ equals the number of distinct odd primes divisors of $n$, and $2^k$ is the largest power of $2$ dividing $n$. If $k=0$ or $k=1$, then $P\cong(\mathbb{Z}/2\mathbb{Z})^m$. If $k>1$, then $P\cong (\mathbb{Z}/2\mathbb{Z})^{m+1} \times \mathbb{Z}/2^{k-2}\mathbb{Z}$.
Counting the number of homomorphisms from $G$ into this, then for $k=0$ or $k=1$ we get $2^m$; for $k=2$ we get $2^{m+1}$ and for $k>2$ we get $2^{m+2}$.
With some more effort, one proceeds to verify that each of these homomorphisms leads to a unique isomorphism class; for that, you essentially have to verify that $G$ either acts trivially or non-trivially on each $p$-Sylow-subgroups; and that it really has four non-isomorphic actions on $\mathbb{Z}/2^k\mathbb{Z}$ if $k>2$ (once you get an action like in a dihedral group, once like in a semidihedral / quasidihedral group; once as in the direct product; and one more).
A: Each Sylow $p$-subgroup of the copy of $\mathbb{Z}/n\mathbb{Z}$ will be normal (actually characteristic) in the semi-direct product. Moreover any element of the semi-direct product not in $\mathbb{Z}/n\mathbb{Z}$ will induce the same automorphism of each Sylow $p$-subgroup since $\mathbb{Z}/n\mathbb{Z}$ is abelian. 
Thus two of your semi-direct products will be isomorphic precisely if each of the subproducts $\mathbb{Z}/p^r\mathbb{Z}$ by $\mathbb{Z}/2\mathbb{Z}$ are isomorphic where $p^r$ is the maximal power of $p$ dividing $n$.
In the square-free case this shows that there are $2^k$ non-isomorphic semi-direct products of the form you require, where $k$ denotes the number of odd prime factors of $n$. 
In the general case this argument atill reduces you to the case $n$ is a prime power. I guess you'll still get two choices for each odd prime dividing $n$ and two choices for the prime $2$ if $4$ divides $n$ but only one otherwise.
