Let $n,m\in\mathbb{N}$. Is there a formula for the number of subgroups of index $n$ in $\mathbb{Z}^m$? Perhaps in terms of the divisors of $n$?



Number of finite index subgroups in a free abelian group
Yes. This is given by OEIS sequence [A160870](https://oeis.org/A160870). The number of subgroups of index $n$ in $\mathbf{Z}^m$ is there denoted $T(n,m)$. There is a recursive formula in terms of the divisors of $n$ given at this page. The initial conditions are
$$ T(n,1) = 1 \quad \textrm{ for all } n\in \mathbb{N}$$
and recursively for $m > 1$, we have either
$$ 
\quad T(n,m) = \sum\_{d \mid n} \left(\frac{n}{d}\right)^{m-1} \cdot T(d, m-1)
$$
or equivalently,
$$ 
\quad T(n,m) = \sum\_{d \mid n} d \cdot T(d, m-1)
$$
Note that we can solve this recurrence to get the "explicit" formula
$$ T(n,m) = \sum\_{\substack{(d\_0,d\_1,\ldots,d\_m)}} d\_1 \cdots d\_{m-1}$$
where the sum is over all sequences of integers $(d\_0,d\_1,\ldots,d\_m)$ with $d\_0=1$, $d\_m=n$, and $d\_i \mid d\_{i+1}$ for all $i=0,\ldots,m-1$.


For example, there are $T(4,5) = 651$ subgroups of index $4$ in $\mathbf{Z}^5$.


