If $f(x)=\sum_{n=0}^{\infty}a_{n}x^{n}$, then $$ \sum_{n=0}^{\infty}a_{kn+m}x^{kn+m}=\frac{1}{k}\sum_{j=0}^{k-1}w^{-jm}f(w^j x) \tag{1},$$ where $w=e^{2\pi i/k}$ is a primitive $k$th root of unity. This is a consequence of $\sum_{j=0}^{k-1}w^{ jm}=0$, $m\not\equiv 0 \pmod{k}$.
This is taken a proof from Special Functions page 14. I want to verify $(1)$. I suppose the series of $f(x)$ is convergent, and we rewrite the $(1)$ as follows
$$\sum_{n=0}^{\infty}a_{kn+m}x^{kn+m}=\sum_{n=0}^{\infty}\underbrace{\frac{1}{k}\sum_{j=0}^{k-1}w^{j(n-m)}}_{=:\,p(n)}a_{n}x^n.$$ If $n=\ell k+m$ for all $\ell\in\mathbb{Z}$, then $$p(\ell k+m)=\frac{1}{k}\sum_{j=0}^{k-1}w^{j\ell k}=\frac{1}{k}\sum_{j=0}^{k-1}1^{j}=1.$$ I think the last sentence in the quote says that if $n\neq \ell k+m$ for all $\ell\in\mathbb{Z}$, then $p(n)=0$. But I am not sure how to check it in general.