TITLE: Automorphisms of a finite non-abelian group
QUESTION [6 upvotes]: Sia $G$ un gruppo non abeliano di ordine $21$, quanti automorfismi possiede un gruppo siffatto?
Translation (by Davide): Let $G$ be a non-abelian group of order $21$. How many automorphisms does such a group possess?

REPLY [3 votes]: A different solution.
Notice first that $G$ has trivial center, so $|\operatorname{Inn}(G)| = |G/Z(G)| =  21$. Thus $|\operatorname{Aut}(G)|$ is a multiple of $21$. Then bound $|\operatorname{Aut}(G)|$ above by $42$, so $|\operatorname{Aut}(G)| = 21$ or $|\operatorname{Aut}(G)| = 42$. Finally, you can find an automorphism that is not inner, and thus it turns out that the answer is $42$ (as usual).
Here are details for the last part. By Cauchy's theorem we find non-identity elements $x$ and $y$ in $G$ such that $x^3 = y^7 = 1$. Since $\langle y \rangle \trianglelefteq G$, we have that $x^{-1}yx = y^{\alpha}$ where $1 \leq \alpha \leq 6$. Then $y = x^{-3}yx^3 = y^{\alpha^3}$, and so $\alpha^3 \equiv 1 \mod 7$. Therefore $\alpha = 2$ or $\alpha = 4$, because $G$ would be cyclic in the case of $\alpha = 1$. Let's assume $\alpha = 2$ for clarity, the other case is similar (and the group would still be the same up to isomorphism). Thus $x^{-1}yx = y^2$.
It is not difficult to show that the elements of $G$ are of the form $x^ky^l$, where $0 \leq k \leq 2$ and $0 \leq l \leq 6$. 
Let $\phi: G \rightarrow G$ be an automorphism of $G$. Because $G$ is generated by $x$ and $y$, we have that $\phi$ is completely determined by the values of $x$ and $y$. Now $\phi(y)$ and $y$ have the same order, so $\phi(y) = y^j$, where $1 \leq j \leq 6$. Similarly $\phi(x)$ and $x$ have the same order, so $\phi(x) = xy^i$ or $\phi(x) = x^2y^i$, where $0 \leq i \leq 6$.
Could it be that $\phi(x) = x^2y^i$? Then $\phi(xy)\phi(xy) = x^2y^{5i+5j}$ and $\phi(xyxy) = \phi(x^2y^3) = xy^{5i+3j}$. Therefore $y^{2j} = 1$, but this means that $y^j = 1$, which is not possible.
Thus there are $7$ possibilities for the value of $\phi(x)$. Since there are $6$ possibilities for the value of $\phi(y)$, we have that $|Aut(G)| \leq 42$. Finally we need to find an outer automorphism. Because $y$ and $y^3$ are not conjugate, we could try $\phi(x) = x$ and $\phi(y) = y^3$.