# Determining all homomorphisms from $\Bbb Z_n \times \Bbb Z_m$ to itself

I know how to determine all homomorphisms from $$\def\Z{\Bbb Z}\Z_n$$ to $$\Z_m$$ (and to itself, naturally), but I can't seem to find an approach towards determining all homomorphisms from $$\Z_n \times \Z_m$$ to itself. For example, from $$\Z_2\times\Z_2$$ to itself.

You can simply send the generator of $\def\Z{\Bbb Z}\Z/n\Z$ to any element $x$ satisfying $nx=0$, and the generator of $\def\Z{\Bbb Z}\Z/m\Z$ to any element $y$ satisfying $my=0$. Then of course $(a,b)$ maps to $ax+by$. The sets of allowed values for $x,y$ are easy to determine, but depend somewhat on possible common divisors of $n$ and $m$.
For instance for $(\Z/2\Z)\times(\Z/2\Z)$, all elements satisfy $2x=0$, so you have $4^2=16$ different group endomorphisms.
• So if not a quotient group, what do you mean by $\Z_n$, the $n$-adic integers? If that is the case you had probably better say it clearly in your question, because most people here will read $\Z_n$ as "the integers modulo $n$" instead (as indeed I did). – Marc van Leeuwen Jan 8 '17 at 9:05