<s>[INST] How do you prove the Cauchy product (multiplication) of two infinite power series (generating functions) which have different exponents/indices? I'm trying to multiply 2 generating functions ( (1/(1-x) ) and ( 1/(1-x^5) ) which have different denominations so that I can find the coefficient. When browsing math.stackexchange I found the equation:
\begin{align*}
\frac{1}{1-x}\cdot\frac{1}{1-x^r}=\sum_{n\ge 0} \left(1+\left\lfloor\frac{n}{r}\right\rfloor\right)x^n
\end{align*}
Could someone go through all of the steps of the equation and explain how and why the product of these two power series are equivalent to the summation shown on the right?
 [/INST] \begin{align*}
  \frac{1}{1-x} \frac{1}{1-x^r}
  &= (1+x+x^2+\cdots)(1+x^r+x^{2r}+\cdots) \\
  &= 1+x+x^2+\cdots \\
  &+ x^r+x^{r+1}+x^{r+2}+\cdots \\
  &+ x^{2r} + x^{2r+1} + x^{2r+2} + \cdots \\
  &+ \cdots
\end{align*}
Every exponent from $x^0, \ldots, x^{r-1}$ is included once, every exponent from $x^r, \ldots, x^{2r-1}$ is included twice, etc. So the coefficient of $x^n$ is $1 + \lfloor n/r\rfloor$.
</s>