Find generating function For sequences

478 Views Asked by At

Can anyone out here help?

The exercise says: "Find the generating function for each of the sequences below (the general term is given)" Now, the question is how do you find one for those: a) $U_n = 3$ if $n$ is a multiple of $2$, otherwise $U_n = 0$ b) $U_n = 5$ if $n$ is a multiple of $3$, otherwise $U_n = 1$

If someone could help out in at least how to get the summation formula here (for line b), it would be really helpful. For a), if I'm not wrong, the summation goes like $\sum_{k = 0}^n 3 (z^2)^k$ and $S(z) = 3/(1-z^2)$. But how do you get that "1" to show when $k$ is not a multiple of $3$ on line b)? It should go something like $\sum 5 (z^3)^k$ , and then be $1z^k$, whenever $k$ is not a multiple of $3$.

Thanks in advance!