This is a question from Wilf's generatingfunctionology, Chapter 2, Exercise 21(a) and (b) (p. 71 in the 3rd edition).
(a) Let $T$ be a fixed set of nonnegative integers. Let $f(n,k,T)$ be the number of ordered representations of $n$ as a sum of $k$ integers chosen from $T$. Find $\sum_n f(n,k,T)x^n$.
(b)Let $g(n,k,T)$ be the number of ordered representations of $n$ as a sum of $k$ distinct integers chosen from $T$. Find $\sum_n g(n,k,T)x^n$.
For part (a) I wrote, for $t_i \in T$
$$\begin{align*} f(n,k,T) &= \sum_{t_1 + \cdots + t_k = n} 1 \\ &= \sum_{t_1 + \cdots + t_k =n} a_{t_1} \cdot \cdots \cdot a_{t_k} & \text{where } a_{t_i} = 1 \ \forall \, i\\ \end{align*} $$
Then, by the power rule for ordinary power series generating functions, we have
$$ \left\{ f(n,k,T) \right\}_{n=0}^{\infty} \leftrightarrow \left( \{ 1\}_{t \in T} \right)^k = \left(\sum_{t \in T} x^t \right)^k. $$
This agrees with the answer provided in the book, but I'm a little uncertain that my final steps are justified (I'm mostly concerned about taking the sum over $t \in T$).
For part (b) the book provides the solution
$$ \sum_n g(n,k,T) x^n = [y^k] \prod_{t \in T}(1+yx^t) $$
I'm at a loss how to arrive at this.
Edited: Part (c) of this question was asked here: Find the Generating Function with respect to n, though the answer doesn't seem to shed light on parts (a) and (b) above.