I need some help on finding the least positive residues. Not sure what the correct approach is to take on these types of problems and the book I'm reading isn't helping me.
** UPDATE **
If 17 was not prime how would I solve this problem? For example, find the least positive residue of $5^{16} \bmod 18$.