Let $G$ be a finitely generated abelian group. Then:
$G \cong \mathbb{Z}^r\times Z_{k_1}\times Z_{k_2} \times ... \times Z_{k_s}$
where $ r,k_1,...,k_s \in \mathbb{Z}$ and $ k_i|k_{i+1}$ for $1 \leq i \leq s-1$ with $k_1,...k_s$ unique.
If we take for example $|G|=100$, then the possibilities for $k_i$ are following:
- $s=1 : k_1=100$
- $s=2: (k_1,k_2)=\{ (2,50),(5,20),(10,10)\}$
My question is when does $\mathbb{Z}^r$ come into play? I am guessing when $|G|=\infty$, but other than the trivial $\mathbb{Z} \cong \mathbb{Z}$ no other examples come to mind. What would be some good examples of groups that are isomorphic to $\mathbb{Z}^r\times Z_{k_1}\times Z_{k_2} \times ... \times Z_{k_s}$ with $r \geq 2$ and $s\geq 1$?
Edit: The $s\geq 1$ was added.
This is just summarizing some stuff that has already been said in the comments, but here are two interesting sources of finitely generated abelian groups in mathematics, which generally have both nontrivial free part and nontrivial torsion part:
The homology groups $H_k(X, \mathbb{Z})$ of a reasonably nice space $X$, e.g. a compact manifold. We already get nontrivial free part + nontrivial torsion part with $X$ a Klein bottle, where $H_1 \cong \mathbb{Z} \times \mathbb{Z}_2$. The rank of $H_k$ is called the Betti number $b_k(X)$. You can find an example with $r \ge 2$ by taking a non-orientable surface with higher genus, say the connected sum of the Klein bottle and a torus.
The group of units of the ring of integers $\mathcal{O}_K$ of a number field, by Dirichlet's unit theorem. We already get nontrivial free part + nontrivial torsion part with $K = \mathbb{Q}(\sqrt{2})$, where the group of units is $\mathbb{Z} \times \mathbb{Z}_2$, with the free part generated by $1 + \sqrt{2}$ and the torsion generated by $-1$. This tells you all solutions to the Pell's equations $x^2 - 2y^2 = \pm 1$ in terms of Pell numbers. You can find an example with $r \ge 2$ by taking number fields of larger degree, for example $\mathbb{Q}(\cos \frac{2\pi}{7})$ which is a totally real cubic field and hence by the unit theorem satisfies $r = 2$.