I am trying to prove the following result.
Let $G$ and $G'$ be two finite abelian groups. Besides, they have the same number of elements of any given order. Prove that $G\cong G'$.
My attempt is by induction on $|G|\geq1$. The base step is obviously true. Now, let $a\in G$ have maximal order. Then $G=\langle a\rangle\oplus H$ for some $H\subset G$. By hypothesis, we can choose an element $a'\in G'$ of maximal order (equal to that of $a$), and therefore $G'=\langle a'\rangle\oplus H'$ for some $H'\subset G'$. Now, I need to show that $H$ and $H'$ have the same number of elements of any given order. If it is true, by induction, it follows that $H\cong H'$. Since $a$ and $a'$ have the same order, it follows that $\langle a\rangle\cong\langle a'\rangle$. Therefore, I can conclude that $G\cong G'$.
My question is: how to show that $H$ and $H'$ still have the same number of elements of any given order?
One of my thought:
It can be shown that $\langle a\rangle$ is a pure subgroup of $G$ and that $G/\langle a\rangle\cong H$. Therefore, it suffices to count $G/\langle a\rangle$. Since $\langle a\rangle$ is pure, for every $g+\langle a\rangle$, we can choose $z\in G$ such that $z+\langle a\rangle=g+\langle a\rangle$, and $ord(z)=ord(g+\langle a\rangle)$. But I still cannot move on based this fact.
Any help? (Maybe it is really a silly question, since it seems that it is really about basic group theory)