Consider the following sum for $$f(z)=\sum (pz^l)^{n_1}(qz^{-1})^{n_2}=\frac1{(1-pz^l)(1-qz^{-1})}.$$$|z|=1$: $$f(z)=\sum z^{ln_1-n_2}p^{n_1}q^{n_2}=\sum (pz^l)^{n_1}(qz^{-1})^{n_2}=\frac1{(1-pz^l)(1-qz^{-1})}.$$ OurWe need only the terms with exponent of $z$ divisible by $k$, thus our sum isequals $\frac1k\sum_{z:z^k=1} f(z)$.