Solution (source code)

= Solution

Proceed by induction on $|G|$. If $p\mid|Z(G)|$, <Cauchy's theorem for finite groups> gives a central subgroup $C$ of order $p$. By induction $G/C$ has a subgroup of order $p^{n-1}$; its inverse image in $G$ has order $p^n$.

If $p\nmid|Z(G)|$, the <class equation> shows that some noncentral conjugacy class has size not divisible by $p$. For a representative $x$, its class size is $[G:C_G(x)]$, so $p^n\mid|C_G(x)|$. This centralizer is proper because $x$ is noncentral, and induction gives it, hence $G$, a subgroup of order $p^n$. This proves Sylow's first theorem.