Question about number of nonnegative integer solutions of linear equation/inequality with positive integer coefficients

152 Views Asked by At

Given $0<a_1 < a_2 <\cdots < a_n$ all integers and $b > 0$ also a integer, $$a_1 x_1 + \cdots a_n x_n \le b \tag{1}$$

Question: how many nonnegative integer solutions $\{x_1, \cdots, x_n\}$ are there for $(1)$?

$$a_1 x_1 + \cdots a_n x_n = b \tag{2}$$

Question: how many nonnegative integer solutions $\{x_1, \cdots, x_n\}$ are there for $(2)$?

My question:

  1. I want to know what's the terminology of above problems such that I can search it. Is there some literatures which systematically tackle the above problems and give some analytic solutions? If there is no analytic solution, except the naive brute force algorithm, is there some more efficient way to determine this number?
1

There are 1 best solutions below

0
On

Knapsack Problems may be related to what you are looking for.

I encountered a special case of equation $(2)$ where all $x_i$'s could be either $0$ or $1$.

Refer the section 'The Knapsack Cryptosystem' in the chapter 'Introduction to Cryptography' in the book 'Elementary Number Theory by David M. Burton'.

If $a_1, a_2, ... , a_n$ forms a superincreasing sequence, it also provides a method for finding a solution.