2

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.

Barb20
  • 31
  • Not an answer, but I think this may give insight. If $N=2$ and you call $n_1=x$ and $n_2=y$, you are basically trying to find the intersection between a plane $z=c$ and $z=a_1x+a_2y$, which is a straight line (in the nicest of cases), and you are trying to see if this line intersects any integer, and for that case there is a solution, and I can see that you're trying to solve such kind of diophantine equation in $N$ dimensions. I'll try to see the literature and come back – TheVal Dec 14 '21 at 09:03
  • As you can see here and especially here the problem for $N>2$ becomes increasingly complex, in fact, a famous nonlinear $N=3$ diophantine equation problem was $x^n+y^n=z^n$, which was a bit tricky to solve for a time – TheVal Dec 14 '21 at 09:10

0 Answers0