I would like to generate a list of all $3$-variable Laurent polynomials with non-negative integer coefficients using a looping construct so that I can, one-by-one, check them for specific specializations.
**Of course, by "all" I mean "all within certain bounds", e.g. on the coefficients, exponents, number of terms... so long as these bounds can be flexibly changed.
Any help would be greatly appreciated.
Sample input/output:
Say we want to produce all ordinary (vs. Laurent) polynomials with non-negative integer coefficients in two variables x,y, subject to:
Maximum coefficient is $2$
Maximum x and y exponents are $1$
Input>
{2,1,1}
Output>
0,
1,
2,
x,
1+x,
2+x,
2x,
1+2x,
2+2x,
y,
1+y,
2+y,
2y,
1+2y,
2+2y,
x+y,
1+x+y,
2+x+y,
2x+y,
1+2x+y,
2+2x+y,
x+2y,
1+x+2y,
2+x+2y,
2x+2y,
1+2x+2y,
2+2x+2y,
xy,
1+xy,
2+xy,
x+xy,
1+x+xy,
2+x+xy,
$\ldots$,
2+2x+2xy+2y
for a total of $3^4 = 81$ items in the list. Note that they do not need to be produced in any particular order.
Again, the "output" should be produced via a loop or otherwise, so that I can perform some analysis on one item of the list and then either "terminate" or move to the next item on the list.
For this simplified example, an input of {a,b,c} will produce a list with $(a+1)^{(b+1)(c+1)}$ items.
