Let $n \in \mathbb{N}$, and let $\mathbb{Z}/n\mathbb{Z}$ be the [cyclic group](/page/Cyclic%20Group) under addition, with $\bar{k}$ denoting the residue class of $k \in \mathbb{Z}$ modulo $n$. Equip $\operatorname{Aut}(\mathbb{Z}/n\mathbb{Z})$ with composition. Equip $(\mathbb{Z}/n\mathbb{Z})^\times$ with multiplication of residue classes, using the standard unital convention that when $n=1$ this unit group is the one-element group. Let
be a group endomorphism. If $\varphi(\bar{1}) = \bar{a}$ for some $a \in \mathbb{Z}$, then $\varphi$ is a group automorphism if and only if $\gcd(a,n)=1$. Equivalently, the map