Simple proof of Cauchy's theorem in Group theory I will refer to the following simple proof of Cauchy's theorem that appears in chapter 33 of Pinter's A Book of Abstract Algebra. I have copied it below so my question can be properly understood.

This proof is crystal clear, however what I cannot understand is why $p$ has to be a prime number? It seems to me that the proof works for any divisor of $|G|$. Could somebody clarify this? I would appreciate it.


Cauchy's theorem: Let $G$ be a finite group of order $n$ and let $p$ be a prime divisor of $n$, then $G$ has an element of order $p$.
Pinter proves Cauchy's theorem specifically for $p=5$; however, he says, the same argument works for any value of $p$.
Consider all possible 5-tuples $(a, b, c, d, k)$ of elements of $G$ whose product $abcdk =e$. 
How many distinct 5-tuples of this kind are there? 
Well, if we select $a, b, c$ and $d$ at random, there is a unique $k=d^{-1} c^{-1} b^{-1} a^{-1}$ in $G$ making $abcdk = e$. Thus, there are $n^4$ such 5-tuples.
Call two 5-tuples equivalent if one is merely a cyclic permutation of the 
other. Thus, $(a, b, c, d, k)$ is equivalent to exactly five distinct 5-tuples,
namely $(a, b, c, d, k)$, $(b, c, d, k, a)$, $(c, d, k, a, b)$, $(d, k, a, b, c)$ and
$(k, a, b, c, d)$. 
The only exception occurs when a 5-tuple is of the form $(a, a, a, a, a)$ with all its components equal; it is equivalent only to itself. Thus, the equivalence class of any 5-tuple of the form $(a, a, a, a, a)$ has a single member, while all the other equivalence classes have five members.
Are there any equivalence classes, other than ${(e, e, e, e, e)}$, with a
single member? If not then $5$ divides $(n^4-1)$ (for there are $n^4$ 5-tuples under
consideration, less $(e, e, e, e, e)$), hence $n^4\equiv 1\pmod 5$. But we are assuming
that 5 divides $n$, hence $n^4\equiv 0\pmod 5$, which is a contradiction.
This contradiction shows that there must be a 5-tuple $(a,a,a,a,a)\neq(e, e, e, e, e)$ such that $aaaaa=a^5=e$. Thus, there is an element $a\in G$ of
order 5. ■
 A: "The only exception occurs when a 5-tuple is of the form $(a,a,a,a,a)$ with all its components equal; it is equivalent only to itself."
This breaks if $p = 6$, for example: $(a, a, b, a, a, b)$. But even then:
"there must be a 5-tuple $(a,a,a,a,a)\neq (e,e,e,e,e)$ such that $aaaaa=a^5=e$. Thus, there is an element $a\in G$ of order 5."
This also breaks if $p = 6$: there are plenty of groups $G$ with non-identity elements $a$ such that $a^6 = e$ because $a$ has order 2 or 3 (consider $C_2$ or $C_3$ and a non-identity element).
A: Well, one major reason that the proof does not work for composite p is that the 'equivalence class' of a p-tuple being cyclically rotated, may not have either exactly one or exactly p elements in it.
For example, if p = 6; look at abcabc.
A: if p is a prime, and a1,a2,...,ap are not all equal, then all p cyclic permutations of (a1,a2,...,ap) are not equal.
for we can use g to represent the permutation of t=(a1,a2,...,ap) to (ap,a1,a2,...),
then e,g,g^2,...g^(p-1) is all the permutations and form a cyclic group. if there exists g^i(t)=g^j(t) then e(t) = g^(j-i)(t), we choose smallest k such that e(t)=g^k(t), then the group generated by g^k will form a subgroup.
there're only two case, 1) the order of the subgroup is 1, this means that k=p, and all the permutations are all different.
2)the order of the subgroup is p, this means that a1,a2,...,ap are all equal which is a contradict .
Q.E.D.
we found that the proof above is not right when p is not a prime. This answers your question.
