Can you tell me why
$$\frac{1}{r} \sum_{k=0}^{r-1} R_N(x^k) \sum_{s=0}^{r-1} e^{\frac{-2 \pi i s k}{r}}=1?$$
Here $R_N(x^k)$ is the remainder of $x^k$ Modulo $N$.
When I entered the last sum in Wolfram Alpha, it gave me $0$, so I am a Little bit confused here.
Thank you very much for your help.
(By the way: This Comes from the Shor-algorithm)
$\sum_{s=0}^{r-1} e^{\frac{-2 \pi i s k}{r}}$ equals $0$ unless $k=0$, in which case it equals $r$. So your expression is equal to $$\frac{1}{r} R_N(x^0) r = R_N(1) = 1$$