Counting homomorphisms by the order of their images

41 Views Asked by At

I am trying to count homomorphisms from $\mathbb Z^r$ to $(\mathbb Z/m)^n$ while keeping track of the order of the image of each map. In other words, for each integer $k$ dividing $m^n$, I want to know how many $r$-tuples of (not necessarily distinct) elements in $(\mathbb Z/m)^n$ generate a subgroup of order exactly $k$.

So in the end one should recover an identity of the form $$m^{nr}=\sum_{k\mid m^n} f_{m,n,r}(k)$$ where $f_{m,n,r}(k)$ is the number of $r$-tuples such that the subgroup generated by such a tuple has order $k$. Because of the context in which this question arises, I'm looking for a closed formula (if it exists) for $f_{m,n,r}(k)$.

I'm then going to need to vary $m$ in a way that gives me essentially no control of its prime factorization, which is why I need a formula and not an algorithm that depends on factoring $m$. I might still be able to do something if $f$ can be stated in terms of arithmetic functions of $m$.

If it helps, in the application I am looking at, $r$ is an even integer $\geq 4$. I'd be very happy to have a formula even just for the case $n=2$ or $n=3$.