TITLE: Products of copies of $\mathbb Z$ that are not semi-direct
QUESTION [7 upvotes]: The problem is to describe (up to isomorphism) all noncommutative groups $G$ containing two elements $a,b$ such that any element $g\in G$ can be uniquely written $g=a^ib^j$ for some $i,j \in {\mathbb Z}$. An obvious example is a semi-direct product of $\mathbb Z$ by itself. Are there other solutions ?

REPLY [2 votes]: Cohn’s article linked by Qiaochu indeed does provide a complete answer (when you combine it with another paper cited in Cohn’s article's references, namely “Zur Theorie der faktorisierbaren gruppen” by L. Redei in Acta. Math. Acad. Sci. Hung. 1, pp.74-98, 1950 ).
The main result (the “Satz 2” in Redei’s paper) is as follows :
If $G$ is a (noncommutative) group and there are pairs $(a,b) \in G^2$ such that any element of $G$ can be uniquely written in the form $a^{i}b^{j}$ with $i,j \in {\mathbb Z}$, then we can always find one such pair  that either
$$
(1) ba=a^{-1}b^{-1}, \ ba^{-1}=ab^{-1} \ (\text{which implies that } \ b^{j}a^{i}=a^{(-1)^ji}b^{(-1)^ij} \ \text{ for any } \ i,j\in{\mathbb Z})
$$ 
or else, there is an integer $g$ such that
$$
(2) ba=a^{-1}b^{-1}, \ ba^{-1}=a^{-1}b^{1-2g} \ (\text{which implies that } \ b^{j}a^{i}=a^{(-1)^ji}b^{j+gi(1-(-1)^j)} \ \text{ for any } \ i,j\in{\mathbb Z})
$$
If we note denote by $D(G)$ the derived subgroup of $G$ and $p$ the quotient map $G \to \frac{G}{D(G)}$, in case (1) $\frac{G}{D(G)}$ is isomorphic to $\frac{\mathbb Z}{4\mathbb Z} \times \frac{\mathbb Z}{2\mathbb Z}$ (indeed $(i,j) \mapsto ip(a)+j(p(b)-2p(a))$ is one such isomorphism) , and in case (2) $\frac{G}{D(G)}$ is isomorphic to $\frac{\mathbb Z}{(2g-1)\mathbb Z} \times \frac{\mathbb Z}{2\mathbb Z}$ (again, $(i,j) \mapsto ip(a)+j(p(b)-2p(a))$ defines one such isomorphism).
So all those groups are non-isomorphic. Finally, as Redei explains, the semi-direct product is simply the $g=0$ case in this family of groups.