Let $S\subseteq \mathbb Z^+$ be set of positive integers. Given $n\in\mathbb Z^+$, how can I find the number of ways in which we can express $n$ as a sum of elements in $S$? ($S$ can be infinite.) $$ n=\sum_{k\in A} k,A\subseteq S. $$ This does not seem very difficult, but I am not familiar with this type of problem. I tried to use the generating function $$ G(x)=\prod_{k\in S} (1+x^k) $$ but obtained little results.
In fact, I am aiming to find all sets $S$ such that the representation $n=\sum_{k\in A} k$ is unique for all $n$. That means the coefficients of $G(x)$ are $1$ for all $x$, i.e., $G(x)=1+x+x^2+\ldots=\frac{1}{1-x}$.
Now, it appears that I am running into a serious piece of analysis/algebra. $\frac{1}{1-z}$ does not have any zeros on $\mathbb C$. Its only zero is $\infty$. But $\prod_{k\in S} (1+z^k)$ does have a lot of zeros, and all of them lie on the unit circle $\{z:|z|=1\}$. It therefore seems that such a set $S$ is not possible.
EDIT: The above argument seems wrong. Indeed, we have $$ \prod_{k=0}^\infty (1+x^{2^k})=1+x+x^2+x^3+\ldots. $$ It is apparent that I am not tackling a lot of technical subtlety in this factorization. (I have not considered the domains of functions here; however, I think such discussion of "zeros" outside the domain might make sense after something like analytic continuation.) I studied the Weierstrass factorization theorem, but it only applies to entire functions; I am not sure what to do with the pole at $z=1$.
Can I evaluate the coefficients of $G(x)$ and what's wrong with my argument in the second part of my question?