I'm studying signal analysis and now I'm at the Fourier series/transformations.
I'm following an example but can't understand the last step.
This problem is divided in two steps.
FIRST
From this Fourier Transformation (FT)

I have to show the expression of the Discrete Time Fourier Transformation (DTFT) and from what frequency I can reconstruct the signal without aliasing.
This is done this way:

I can understand all of these steps so no problem here.
SECOND
I have to determine the Discrete Fourier Transformation (DFT) assuming $f_s=50Hz$ and that the DFT assumes a window with $500$ samples. This is done this way:

Can someone please point me in the right direction? I can't understand the red dotted square.
All that happens in the red dotted square is plugging $f_s=50$ and $\omega=k \pi/5$ into the formula for $X_{DTFT}$ written above. It should be noted that $X_{DTFT}$ is periodic with period $\omega_s=2\pi f_s=100\pi$, and the formula we have for it is written in terms of $\omega- k\omega_s$. This means we sometimes have to subtract an appropriate multiple of the period from $\omega$ to place the difference $\omega- k\omega_s$ into a range where the formula applies.