\[a\]
modulo \[n\]
must divide \[\phi (n)\]
since \[a^{\phi (n)} \equiv 1 \; (mod \; n)\]
by Euler's Theorem.This means that 17 has no integers that have order 6, since
\[\phi (17)=16\]
.On the other hand
\[\phi (18)=6\]
since 1, 5, 7, 11, 13 and 17 are relatively prime to 18, so the modulo 17 may have integers of order 6. In face 5 and 11 have orders 6 modulo 18 since \[5^6= 15625 \equiv 1 \; (mod \; 18)\]
and \[11^6=(1331)^2 \equiv (-1)^2 \; (mod \; 18) \equiv 1 \; (mod \; 18)\]
but not for any lesser power.