Fundamental Theorem of Abelian Groups From fundamental theorem of finite abelian groups I can say any finite abelian group $G$ is isomorphic to direct sum of cyclic groups i.e,
$G\cong Z_{{p_1}^{i_1}}\oplus Z_{{p_2}^{i_2}}\oplus Z_{{p_3}^{i_3}}\oplus ......Z_{{p_k}^{i_k}}$
where ${p_1} , {p_2} , {p_3} ..... {p_k}$ are all prime numbers need not to distinct. Can someone explain me with a counterexample to disprove that all $p_{j's}$ must be distinct. Also can anyone tell me when are $p_{j's}$ distinct. Also I read that it is equivalent saying that when all $p_{j's}$ are distinct then G is cyclic group but I didn't get it. Please help me in understanding this.
 A: You can construct as many counterexamples as you like by taking direct sums of $\mathbb Z$ modulo powers of a given prime. Concretely, a counterexample would be provided by something like $H=\mathbb Z/2\mathbb Z \oplus \mathbb Z/2 \mathbb Z$. By the uniqueness part of the fundamental theorem, we know that $H$ cannot be isomorphic to $\mathbb Z/ 4 \mathbb Z$. But you can also see this directly -- consider the order of elements. 
Your characterization of abelian groups with all $p_i$'s distinct is true, and follows from the following lemma: 

If $gcd(m,n)=1$ then $$\mathbb Z/ n \mathbb Z \oplus \mathbb Z/m \mathbb Z \simeq \mathbb Z/ mn \mathbb Z.$$

Indeed, let $a$ generate $\mathbb Z/ n \mathbb Z$ and $b$ generate $\mathbb Z/  m \mathbb Z$. Then $(a,0)*(0,b)$ has order $lcm(|a|,|b|)=lcm(m,n)$ since the group is abelian. But the gcd condition implies $lcm(m,n)=mn$, which is the order of the group, and $(a,0)*(0,b)$ is a generator. 
Do you see how to apply this lemma to get the fact that all $p_i$'s are distinct if and only if the group is cyclic?
