Products of copies of $\mathbb Z$ that are not semi-direct 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 ?
 A: Still not a complete answer. By hypothesis we can write $aba^{-1} = a^i b^j$ and $a^{-1} ba = a^k b^{\ell}$ for unique $i, j, k, \ell$. Composing these operations in both orders gives
$$b = a^{i + jk} b^{j \ell} = a^{k + i \ell} b^{j \ell}$$
which by uniqueness gives $j \ell = 1, i + jk = k + i \ell = 0$.
Case: $j = \ell = 1$. Then $i + k = k + i = 0$, so $k = -i$. This gives
$$aba^{-1} = a^i b \Leftrightarrow b = a^{i-1} ba \Leftrightarrow bab^{-1} = a^{1-i}.$$
But we also have $b^{-1} ab = a^m b^n$ for unique $m, n$. Composing in both orders gives
$$a = a^{(1-i)m} b^{(1-i)n} = a^{(1-i)m} b^n$$
which by uniqueness gives $n = 0, 1-i = m = \pm 1$.
Subcase: $1-i = m = 1$. Then $ab = ba$ and our group is $\mathbb{Z}^2$.
Subcase: $1-i = m = -1$. Then $b^{-1} ab = a^{-1}$ and our group is the nontrivial semidirect product $\mathbb{Z} \rtimes \mathbb{Z}$ (the fundamental group of the Klein bottle).
Case: $j = \ell = -1$. Then $i - k = k - i = 0$, so $k = i$. This gives $aba^{-1} = a^i b^{-1} = a^{-1} ba$, hence $a^2 b = b a^2$. I suspect that this group is a familiar one but I don't currently recognize it.
Edit: This problem appears to be solved in P. M. Cohn's A Remark on the General Product of two Infinite Cyclic Groups.
A: 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.
