# The number of ring homomorphisms from $\mathbb{Z}_m$ to $\mathbb{Z}_n$

I face the problem of finding how many non-trivial ring or group homomorphisms there are from $\mathbb{Z}_m$ to $\mathbb{Z}_n$, where $m<n$. Is there any general formula?

At the moment, I want to know how many ring homomorphisms there are when $m=12,n=28$.

• A ring homomorphism requires sending the identity to the identity, so this question isn't very interesting. Do you mean module homomorphisms instead? That is a better question, in my opinion. – Potato Dec 21 '12 at 6:05
• @Potato: There are some who disagree with including that requirement in the definition of ring homomorphism (e.g. Herstein). I imagine it mainly arises because, if rings are not required to have multiplicative identities in the first place, one should make a distinction between a ring homomorphism between two rings each of which happens to have a unity, vs. a ring-with-unity homomorphism. – Zev Chonoles Dec 21 '12 at 6:12
• @ZevChonoles I see. I was not aware -- I learned from Jacobson, who requires sending the identity to the identity. – Potato Dec 21 '12 at 6:14
• For groups, see math.stackexchange.com/questions/273169 – Watson Jan 19 '17 at 20:53

Hint: regardless of whether you're considering ring or group homomorphisms, where you send $1$ determines where you must send everything else, because for any $n$, $$f(n)=f(\underbrace{1+\cdots+1}_{n\text{ times}})=\underbrace{f(1)+\cdots+f(1)}_{n\text{ times}}$$

But where can you send $1$? Remember, the resulting function must be a homomorphism: $$f(a+b)=f(a)+f(b)\qquad f(ab)=f(a)f(b)$$ Try to figure out what conditions this imposes on your choice of $f(1)$. See user26857's answer if you are stuck.

Note that the answer will depend on whether you require that a ring homomorphism $f:R\to S$ must preserve multiplicative identities, i.e. $f(1_R)=1_S$.

• ok so for ring homo from $Z_{12}\rightarrow Z_{28}$, I can send $1_{Z_{12}}$ to 27 possible elements, so does it mean I will get $27$ non trivial ring homo? – Marso Dec 21 '12 at 6:02
• @Kuttus: How many generating elements are there in $\mathbb Z_{12}$? just one element? – mrs Dec 21 '12 at 6:05
• @Kuttus: Even if you don't require ring homomorphisms to preserve multiplicative identities, you cannot send 1 to any element of $Z_{28}$. Homomorphisms send 0 to 0, and must preserve addition... – Zev Chonoles Dec 21 '12 at 6:05
• @user26857: The idea of a hint is to help the OP figure an answer out for themselves. Additionally (and as I pointed out in my answer), it's quite common to require $f(1)=1$ for a ring homomorphism, and under that definition your answer is incorrect. That seems like an important thing to have missed. – Zev Chonoles Dec 7 '15 at 17:44
• I'd have taken this as a good reason, but unfortunately the whole discussion into the comments shows that the OP has no idea what's going on and you didn't help him clarify things. – user26857 Dec 7 '15 at 17:56

A ring homomorphism $f:\mathbb Z_m\to \mathbb Z_n$ is uniquely determined by the conditions: $mf(1)=0$ and $f(1)^2=f(1)$.
In order to find out how many ring homomorphisms there are we have to count the number of elements of the set $\{e\in\mathbb Z_n:e^2=e,me=0\}$. It is not hard to see that this equals $2^{\omega(n)-\omega(n/(m,n))}$, where $\omega(a)$ is the number of distinct prime factors of $a$. (See Gallian and Van Buskirk, The Number of Homomorphisms from $\mathbb Z_m$ to $\mathbb Z_n$, AMM, 91(1984), 196-197.)

For particular cases we don't need the above result. For instance, if $m=12$ and $n=28$ we get $0=me=12e$ in $\Bbb Z_{28}$ iff $28\mid 12e$ iff $\,7\mid e,\,$ so $f(1)\in\{0,7,14,21\}$ and only $0$ and $21$ are idempotent in $\Bbb Z_{28},$ so there are two ring homomorphisms from $\mathbb Z_{12}$ to $\mathbb Z_{28}$.

Edit. If one asks $f(1)=1$ then the problem becomes trivial: there is a unitary ring homomorphism iff $n\mid m$.