Solution (source code)

= Solution

We first prove the needed instance of <Cauchy theorem for groups>, rather than invoke it. Let a <prime number> $q$ divide $|G|$ and consider the set
$$
\mathcal T=\{(g_1,\ldots,g_q):g_1\cdots g_q=1\}.
$$
There are $|G|^{q-1}$ such tuples: choose the first $q-1$ entries freely, and the last is forced. Cyclic rotation preserves this set, because moving the first entry to the end conjugates the product, which remains $1$. Each rotation <orbit of a group action> has either one or $q$ elements. Indeed a nontrivial shift fixing a tuple generates all shifts, since its step has an inverse modulo the prime $q$. The fixed tuples are precisely $(g,\ldots,g)$ with $g^q=1$.

Counting nonfixed orbits in multiples of $q$, and using $q\mid |G|^{q-1}$, shows that the number of solutions of $g^q=1$ is divisible by $q$. The identity supplies one solution, so there is a nonidentity solution. If its <order of a group element> is $d$, divide $q$ by $d$: the remainder would give a smaller positive exponent producing the identity, so $d\mid q$. Hence $d=q$. This proves the required prime-order existence result by the <cyclic-tuple proof of Cauchy theorem>.

Our hypothesis says that this nonidentity element has order $p$, so $q=p$. Every prime divisor of $|G|$ is therefore $p$, which gives
$$
\boxed{|G|=p^n\quad\text{for some }n\ge0.}
$$
Thus a <finite group of prime exponent has prime-power order>. The case $n=0$ includes the trivial <group>. No <group>-theoretic counting theorem was assumed in the tuple argument.