Question: I would like to find a condition for an exact sequence of abelian groups
$$
0\to H\to G\to K\to 0
$$
to split. Assume for simplicity that $H=\langle h \rangle$ is cyclic, and choose a basis for $G= \langle g\_1 \rangle \oplus \ldots \oplus \langle g\_n \rangle$. Write $h= \sum a\_i g\_i$, with $0 \leq a\_i < o(g\_i)$, where $o(g\_i)$ is the order of $g\_i \in G$.

By looking at examples, it seems to me that the exact sequence splits if and only if
$$
\gcd(o(h), a\_1, \ldots, a\_n)=1.
$$
Is this last statement correct? (and, if so, why?)

Answer: 
This is wrong, as shown by the accepted answer to my question on MO:
<https://mathoverflow.net/questions/107768/on-the-existence-of-a-direct-summand-containing-a-fixed-subgroup>

A simple example is the subgroup generated by $\langle (2,1) \rangle $ inside $\mathbb{Z}\_8 \oplus \mathbb{Z}\_2$. This is a subgroup of order $4$ whose quotient is cyclic of order $4$, generated by the equivalence class of $(1,0)$. Clearly $\mathbb{Z}\_4 \oplus \mathbb{Z}\_4 \neq \mathbb{Z}\_8 \oplus \mathbb{Z}\_2$.

The answer of Steve D shows that the GCD condition is necessary, but in fact it is not sufficient as this example clearly shows.
Assuming we have the short exact sequence

$$0\longrightarrow H\stackrel{f}\longrightarrow G\stackrel{g}\longrightarrow K\longrightarrow 0$$

then the sequence splits iff there exists *a homomorphism* $\,\gamma:K\longrightarrow G\,$ s.t. $\,g\circ \gamma=Id\_K\,$ , iff there exists *a homomorphism* $\,\phi:G\longrightarrow H\,\,s.t.\,\,\phi\circ f=Id\_H\,$ .

You can find a proof of the above, sometimes known as the splitting lemma, [here](http://en.wikipedia.org/wiki/Splitting_lemma)