What is the Discrete Fourier Transform of a periodic sequence?

Shor's algorithm utilises the properties of quantum computers to find $$r$$ in, $$a^r = 1 \mod n$$ wherein $$r$$ is even and $$a^{r/2} + 1\neq 0$$. However I haven't been able to find any resources in how this relates to the Discrete Fourier Transform? As in how is the DFT of a sequence taken?