TITLE: Request for an exact formula related to a partition in number theory
QUESTION [5 upvotes]: The Frobenius equation is the Diophantine equation $$
a_1 x_1+\dots+a_n x_n=b,$$ 
where the $a_j$ are positive integers, $b$ is an integer, and a solution $$(x_1, \dots, x_n)$$ 
must consist of non-negative integers, i.e. 
$$
x_j \in \mathbb{N}
$$
as Natural numbers. For negative $b$, there are no solutions.

My question: Is there any known formula that counts the number of solutions, by giving $a_1, \dots, a_n$, $b$, and $n$? Let us call this function as $F (a_1, \dots, a_n; b, n)$, what is known for this: 


$$F (a_1, \dots, a_n; b, n)=?$$


For all the $a_j=1$, we can simplify the above Frobenius equation to:
$$
x_1+\dots+x_n=b, \tag{1}$$
where $b \in \mathbb{Z}^+$ is a positive integer. 

Here is another simpler question:  Is there a general formula for Eq.(1) counting all the possible solutions $$(x_1, \dots, x_n)$$
for given the positive integer $n \in \mathbb{Z}^+$ and $b \in \mathbb{Z}^+$? This should be related to the Partition, but I am not sure the exact forms are known? Say, can we find the total number of soultions as a function $f(n,b)$, and what is
$$
f(n,b)=?
$$

It seems the answer is known:

$$
f(n,b)= \binom{b+n-1}{n-1}.
$$

p.s. Sorry if this question is too simple for number theorists. But please provide me answer and Refs if you already know the answer. Many thanks!

REPLY [4 votes]: You can take generating function $$f(z):=\frac{1}{1-z^{a_1}}\frac{1}{1-z^{a_2}}\cdots \frac{1}{1-z^{a_n}}$$ as in Max Alekseyev's answer and calculate $F (a_1, \dots, a_n; b, n)$ as $$
\frac{1}{2 \pi i} \int_{|s|=\rho} f(s) \frac{d s}{s^{b+1}} \quad (0<\rho<1).
$$
It gives the answer
$$
F (a_1, \dots, a_n; b)=\frac{b^{n-1}}{(n-1) !  a_{1} \ldots a_{n}}+\sum_{k=0}^{n-2} c_{k} b^{k}.
$$
It is a classical applications of  contour integration taken from the book "Residues and their applications" by  A.O. Gelfond (1966, pp. 98-99, Russian). If $(a_j,a_k)=1$ ($j\ne k$) then all poles (excepting $s=1$) are simple and formula can be simplified:
$$
F (a_1, \dots, a_n; b)=\frac{(-1)^{n-1}}{(n-1) !} \frac{d^{n-1}}{d s^{n-1}}\left[s^{-b-1} \prod_{k=1}^{n} \frac{1-s}{1-s^{a_{k}}}\right]_{s=1}+R 
$$
where $|R|<C$ for some constant $C$.