Let $n$, $r$, and $m$ all be positive integers, $r\le m$, and $\omega_k=e^{\frac{2k\pi}{m}i}$ be a complex root to the equation $x^m=1$. Show $$\sum_{k=0}^{\lfloor{\frac{n-r}{m}}\rfloor}\binom{n}{r+km}x^{r+km}=\frac{1}{m}\sum_{k=0}^{m-1}\omega^{-r}(1+x\omega_k)^n$$
where function $\lfloor{x}\rfloor$ returns the largest integer not exceeding real number $x$.