This is a question from the MIT opencourseware Mathematics for Computer Science, problem set 3:
Use Euler's theorem to find the inverse of $17$ modulo $31$ in the range $\{1,...,30\}$.
I don't seem to be able to actually use Euler's theorem here. Since both $17$ and $31$ are primes the $\gcd$ is $1$, so $K^{\varphi(n)-1} = 17^{29}$, which works here for an inverse, but how does that help me find an inverse in the $1,...,30$ range?