My abstract algebra text has the following proof of the statement, "Let $G$ be a cyclic group with $n$ elements and generated by $a.$ Then $\langle a^s \rangle = \langle a^t \rangle \iff \gcd(s,n) = \gcd(t,n).$"
Proof: Taking for the moment $\mathbb Z_n$ as a model for a cyclic group of order $n,$ we see that if $d$ is a divisor of $n,$ then the cyclic subgroup $\langle d \rangle$ of $\mathbb Z_n$ has $n/d$ elements, and contains all the positive integers $m$ less than $n$ such that $\gcd(m,n) = d.$ Thus there is only one subgroup of $\mathbb Z_n$ of order $n/d$. Combined with our above result regarding the order of subgroups of a cyclic group, this shows at once that if $a$ is a generator of the cyclic group $G,$ then $\langle a^s \rangle = \langle a^t \rangle$ iff $\gcd(s,n) = \gcd(t,n).$
What is confusing me about this proof is the assertion that if $d$ is a divisor of $n,$ then the cyclic subgroup $\langle d \rangle$ of $\mathbb Z_n$ contains all the positive integers $m$ less than $n$ such that $\gcd(m,n) = d.$ For example, let $n = 24$ and $d = 6.$ Then $\langle 6 \rangle = \{0,6,12,18\}$, but $\gcd(12,24) = 12 \neq 6.$ Isn't this a contradiction of the assertion in the book?