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?
Together with a function, is his friend the domain of definition, often forgotten.
Choosing an order on $S$. Let $D\subset\mathbb{C}$ the set of $x\in\mathbb{C}$ such that the series $\prod_{i=1}^n(1+x^{k_i})$ converges. Then generally, the unit circle is not contained in $D$, which is the reason why your reasoning on roots is not valid. Similar observation for the series $1+x+x^2+\dots$.
Now let $f$ be the function defined by this limit on $D$. There may exist an extension (not necessarily unique, but can be unique under additional requirement(s)) of $f$ to a domain containing $D$. Suppose $f':D'\rightarrow*$ is such an extension. Then the power of the formula $\lim_n\prod_{i=1}^n(1+x^i)$ stays inside $D$. One can extract information of $f'$ from $f$ (according to how you extend: analytically? continuously?), but this should be done carefully.