<s>[INST] Find $\operatorname{ord}_{17} (a)$ for all $a = 1, \ldots, 16$ The  $\operatorname{ord}_{m} (a)$ is defined as the least positive integer $x$ satisfying $a^x \equiv 1 \mod m$. 
To find  $\operatorname{ord}_{17} (a)$ for all $a = 1, ..., 16,$ I know I can go through each numbers from 1 to 16 one by one (and have gotten 1, 8, 16, 4, 16, 16, 16, 8, 8, 16, 16, 16, 4, 16, 8, 2), but is there any trick to it without having to go through them one by one?
 [/INST] So here are some tricks which might help to reduce the work.
If $a\neq \pm 1$ and the order of $a$ is even, then $-a(\equiv 17-a)$ will have the same order as $a$.
The numbers for which $a^r\equiv 1 \bmod m$ form a group. Therefore $a$ and $a^{-1}$ have the same order. Here you have $18\equiv 1 \bmod 17$ and $18=2\times 9=3\times 6$ so that $9$ has the same order as $2$ and $6$ has the same order as $3$. Also $35 \equiv 1$ so you can do the same trick with $5$ and $7$.
Further, if $a$ has even order, $a^2$ will have half the order of $a$.

So $1$ has order $1$ and $-1$ has order $2$.
$2$ has the same order as $15$ and $9$ and $8$
$3$ has the same order as $14$ and $6$ and $11$
$4$ has the same order as $13$ and $4^2=16\equiv -1$ so $4$ has order $4$.
$5$ has the same order as $7, 12, 10$
So we can combine these as follows. $2^2=4$ has order $4$ so $2$ has order $8$ (clearly a factor of $8$ and can't be less).
$3^2=9$ has order $8$, so $3$ has order $16$ (again easy to check can't be less).
$5^2=25\equiv 8$ has order $8$ so $5$ has order $16$ too.
This is made somewhat easier by the fact that $17-1=16$ has only the prime factor $2$, and squaring is easy. Tricks are fine for small cases, but a more systematic approach wins out in general.
</s>