Consider the following equation: $$ c=\sum\limits_{i=1}^{N}{{{n}_{i}}}{{a}_{i}} $$ where $c$ and $a_i$ are positive real numbers, and $n_i$ is an integer equal or larger than zero.
Given $c$ and $a_i$, how many solutions (i.e., ensembles $\{n_i\}$) does this equation have?
Note I'm not interested in finding the solutions (the values of $n_i$) but in finding the number of solutions.
If all $a_i$ had the same value, say $a$, this question would reduce to a simple combinatorial problem. The equation would simplify to $$ c=a\sum\limits_{i=1}^{N}{{{n}_{i}}} $$ Then, I could define an integer $m=c/a$, and the number of solutions for a given c would be $$ \Omega \left( c \right)=\left( \begin{matrix} m+N-1 \\ N-1 \\ \end{matrix} \right) $$
However, I can't find my way around for different $a_i$ values. The numerical solution is simple; I got it with a dozen lines of code. But I'm struggling for a couple of weeks already without grasping an analytical solution.
Do you have any idea to approach this problem, even if for an approximated solution? Is it already solved anywhere?
Thank you for any insight.