Problem
Find all finite abelian groups that simultaneously have exactly $7$ elements of order $2$, exactly8 elements of order $3$, exactly $8$ elements of order $4$, at least an element of order $9$, and no element of order $p$ prime for $p \neq 2,3$.
My attempt at a solution:
Let $G$ be a group with such conditions. Then, we can see $G$ as a $\mathbb Z$-module. Since $\mathbb Z$ is a PID and $G$ is finitely generated, by the structure theorem we have $$G \cong \mathbb Z^n \oplus \mathbb Z/\langle {p_1}^{\alpha_1}\rangle \oplus ... \oplus \mathbb Z/\langle {p_n}^{\alpha_n}\rangle, \space p_i \space \text{prime}, \space n\geq 1$$
But $|G|.g=0$ for all $g \in G$, from here it follows $n=0$. As the order of the elements has to be $1,2,3,4$ or $9$, then $p_i \in \{2,3\}$.
From this point I've started to count the number of elements of these orders for the groups and the possibilities. It started to get pretty ugly combining these in order to construct $G$. For example, I've look at a few of examples of groups of order $\mathbb Z_{3^k}$ with $k \geq 2$,and I've found that in all of these cases there are exactly two elements of order $3$, as there have to be exactly $8$ elements of order $3$ and at least one of order $9$, then I arrived to the conclusion that $G\cong \mathbb Z/\langle {3^k} \rangle \oplus \mathbb Z/\langle 3^j\rangle \oplus \mathbb Z/\langle 2^{k_1} \rangle \oplus ... \oplus \mathbb Z/\langle 2^{k_n}\rangle$. But I've only seen there are exactly two elements of order $3$ for the groups $\mathbb Z_9$ and $\mathbb Z_{27}$ and $\mathbb Z_{81}$, I don't know and couldn't show that this is the case for all groups of that form ($\mathbb Z_{3^k}$,$k\geq 2$).
I got stuck trying to determine the rest of the quotients that are related to the elements of order $2$ and $4$.
I would appreciate some help to get me organized with this, to count all the possible cases so as to not exclude or forget any case.
Here is a hint: count the elements of order $p$ in the group
$$ \mathbb Z/p^{i_1} \oplus\mathbb Z/p^{i_2} \oplus \dots \oplus \mathbb Z/p^{i_n}.$$
Here's the answer to the hint:
Solve the equations $2^n-1=7$ and $3^m-1=8$ to conclude that your group is of the following form:
$$ \mathbb Z/2^u \oplus \mathbb Z/2^v \oplus \mathbb Z/2^w \oplus \mathbb Z/3^a \oplus Z/3^b, \quad u,v,w,a,b\geq 1 $$
(Note that 'mixed' elements that are non-zero in both the $2$- and $3$-components will have order divisible by $6$ so we don't need to worry about these.)
Next, count elements of order $4$ in $\mathbb Z/2^u \oplus \mathbb Z/2^v \oplus \mathbb Z/2^w$. Let us instead, for notational convenience, determine the number of elements of order $p^2$ in a group of order $\mathbb Z/p^{i_1}\oplus\dots\oplus\mathbb Z/p^{i_n}$. Their number is given by
$$ \prod_{\ell=1}^n \mathrm{max}(p^2,p^{i_\ell}) - \prod_{\ell=1}^n \mathrm{max}(p,p^{i_\ell}), $$
i.e. the number of elements of order $1, 2$ or $4$ minus the number of elements of order $1$ or $2$.
To see this, imagine writing down an element $(x_1,x_2,\dots,x_n)$ of order $p^2$. In order for this to be possible, each element $x_i$ must have the property that $p^2\cdot x_i=0$ and additionally the element may not have order $p$. (This is quite similar to the reasoning above.) Each cyclic group of order at least $p^2$ will have exactly $p^2$ elements $x$ such that $p^2\cdot x = 0$, in fact this is the unique subgroup of order $p^2$. If the order is less than $p^2$, these are simply all elements.
In our case, since we have $u,v,w \geq 1$, we must without loss of generality only distinguish the cases where (1) $u,v,w>1$, (2) $u,v>1$ and $w=1$, (3) $u>1$ and $v=w=1$, (4) $u=v=w=1$. The number of elements of order $4$ in each case is given by (1) $4^3-2^3$ (2) $4^2\cdot 2-2^3$ (3) $4\cdot 2^2-2^3$ (4) $2^3-2^3$, so we must be in case (3).
So my conclusion is that (up to permuting $u,v,w$ and $a,b$) $u=1$ and $a\geq 2$ are necessary and sufficient conditions.