Number of index $p^k$ subgroups I'm trying to find the number of subgroups of $\mathbb{Z}^n$ such that the quotient is a $\bf{cyclic}$ group of order $p^k$ ($p$ a prime).
I guess I don't know enough about the finitely generated abelian groups, though I consulted some results about that. So I hope for a hint, thank you very much.
 A: This is a much-studied question. For the general theory see the paper:
Grunewald, F. J.; Segal, D.; Smith, G. C., Subgroups of finite index in nilpotent groups, Invent. Math. 93, No. 1, 185-223 (1988). ZBL0651.20040.
Their proposition 1.1 shows that for subgroups of prime power index we have the following zeta function:
$$\prod_{i=1}^{d-1}(1-p^j p^{-s})^{-1},$$
where the coefficient of $p^{-ks}$ is the number you seek.
A: Subgroups $K \le {\mathbb Z}^d$ with ${\mathbb Z}^d/K \cong C_{p^r}$ are kernels of surjective homomorphisms from ${\mathbb Z}^d$ to $C_{p^r}$, so let's find the number of surjective  homomorphisms.
The total number of homomorphisms is $(p^r)^d = p^{rd}$. A homomorphism is surjective if the image of at least one generator generates $C_{p^r}$. So the number that are not surjective is $p^{(r-1)d}$, and the total number of surjective homomorphisms is
$$p^{rd} - p^{(r-1)d}.$$
But some of these will have the same kernel. In fact homomorphisms $\phi$ and $\psi$ have the same kernel if and only if there exists $\alpha \in {\rm Aut}(C_{p^r})$ with $\alpha\circ \phi = \psi$. Since $|{\rm Aut}(C_{p^r})| = p^{r-1}(p-1)$, the total number of kernels, which is the required number of subgroups,  is
$$\frac{p^{rd} - p^{(r-1)d}}{p^{r-1}(p-1)}.$$
I agree that this part of the questions seems to be significantly more challenging than the other parts!
