Statement

Let m,n≥1m,n\geq1 be integers and write the additively as Cm=Z/mZC_m=\mathbb Z/m\mathbb Z and Cn=Z/nZC_n=\mathbb Z/n\mathbb Z. Evaluation at 11 identifies the with the residues a∈Z/nZa\in\mathbb Z/n\mathbb Z satisfying ma=0ma=0: the corresponding map is fa([k]m)=[ka]nf_a([k]_m)=[ka]_n. Thus

∣Hom⁡Grp(Cm,Cn)∣=gcd⁡(m,n),End⁡Grp(Cn)≅Z/nZ,Aut⁡Grp(Cn)≅(Z/nZ)×.|\operatorname{Hom}_{\mathbf{Grp}}(C_m,C_n)|=\gcd(m,n),\qquad \operatorname{End}_{\mathbf{Grp}}(C_n)\cong\mathbb Z/n\mathbb Z, \qquad \operatorname{Aut}_{\mathbf{Grp}}(C_n)\cong(\mathbb Z/n\mathbb Z)^\times.

The middle isomorphism is of rings, with pointwise addition of endomorphisms and composition as multiplication. The last is an .

Verification

A homomorphism must send [k]m[k]_m to kf([1]m)k f([1]_m). It is well-defined exactly when the relation m[1]m=0m[1]_m=0 is preserved, which says n∣man\mid ma. Put d=gcd⁡(m,n)d=\gcd(m,n). This divisibility is equivalent to n/d∣an/d\mid a, giving the dd residues 0,n/d,…,(d−1)n/d0,n/d,\ldots,(d-1)n/d.

For m=nm=n, every residue is allowed and fa∘fb=fabf_a\circ f_b=f_{ab}. Such a map is invertible precisely when aa is a unit modulo nn. The formula also covers n=1n=1: there is one map and it is the identity on the trivial group.

Forgetting the group structure changes the answer

The underlying sets admit nmn^m functions from CmC_m to CnC_n, while the groups admit only gcd⁡(m,n)\gcd(m,n) homomorphisms. In particular, C2→C3C_2\to C_3 has nine set maps but just one group map, the zero map.

For one group CnC_n, the set endomorphisms number nnn^n and the set automorphisms number n!n!; the group endomorphisms number nn. The categories of groups, , and give the same homomorphisms on these objects.