Counting the number of particular subgroups of a finite abelian group I want to count subgroups $H$ isomorphic to $\mathbb{Z}/3\mathbb{Z}\times  \mathbb{Z}/3\mathbb{Z}$ in a group $G$ isomorphic to $\mathbb{Z}/3\mathbb{Z}\times\mathbb{Z}/9\mathbb{Z}\times\mathbb{Z}/81\mathbb{Z}$
My idea is that, I count the elements of order $3$ in $G$, that are $3\cdot3\cdot3-1=26$ and they are the possible elements of the first $\mathbb{Z}/3\mathbb{Z}$ in $H$, and then I count again the elements of order  $3$ in $G$ but I remove two possible elements because the generators of $\mathbb{Z}/3\mathbb{Z}\times\{0\}$ and of the second $\{0\}\times\mathbb{Z}/3\mathbb{Z}$ have trivial intersection. So there should be $26\cdot24$ subgroups.
Is this way to go right?
 A: We have that $G=\Bbb{Z}_3\times\Bbb{Z}_9\times\Bbb{Z}_{81}$. Let $N$ be the set of elements of order $1$ or $3$. Then $N$ is a subgroup of $G$, and $N\cong\Bbb{Z}_3\times\Bbb{Z}_3\times\Bbb{Z}_3$. Also note that if $H$ is a subgroup of $G$ with $H\cong\Bbb{Z}_3\times\Bbb{Z}_3$, then $H$ will also be a subgroup of $N$, since every element of $H$ will have order $1$ or $3$. So it is enough to count how many subgroups of $N\cong\Bbb{Z}_3\times\Bbb{Z}_3\times\Bbb{Z}_3$ are isomorphic to $\Bbb{Z}_3\times\Bbb{Z}_3$.
It might help to think of this problem as a linear algebra problem. Note that (1) $N\cong\Bbb{Z}_3\times\Bbb{Z}_3\times\Bbb{Z}_3$ is a vector space over $\Bbb{Z}_3$, (2) subgroups of $N$ are subspaces of $N$, and (3) subgroups isomorphic to $\Bbb{Z}_3\times\Bbb{Z}_3$ are two-dimensional subspaces. So we're really trying to count the number of two-dimensional subspaces of $N$.
To pick a two-dimensional subspace, we first pick a non-zero vector: there are $3^3-1$ ways to do that. Next we pick a vector that is not in the span of the first vector we picked: there are $3^3-3$ ways to do that. So it may at first seem that there are $\left(3^3-1\right)\cdot\left(3^3-3\right)$ two-dimensional subspaces....
The problem is that we may have double counted. To find out how often we counted each two-dimensional subspace, we need to find out how many bases each two-dimensional subspace has. To pick a basis, we first pick a non-zero vector: there are $3^2-1$ ways to do that. Next we pick a vector that is not in the span of the first vector we picked: there are $3^2-3$ ways to do that. So each two-dimensional subspace has $\left(3^2-1\right)\cdot\left(3^2-3\right)$ bases.
Hence the number of subgroups isomorphic to $\Bbb{Z}_3\times\Bbb{Z}_3$ is
$$\frac{\left(3^3-1\right)\cdot\left(3^3-3\right)}{\left(3^2-1\right)\cdot\left(3^2-3\right)}=13.$$
