Yes, @vdelecroix, in these cases this might be a very good option.
sage: list( [x,y] for x in range(1,10) for y in range(1,10) if x+y==15)
[[6, 9], [7, 8], [8, 7], [9, 6]]
For a more general setting, normaliz, 4ti2 and other approaches are better;
some are available in sage as pointed above.
O
In this particular instance, I would rather write down the loop.
It is not hard to make the loop general for any bound on x and
y and any sum.
sum = 15
xmin = 1
xmax = 9
ymin = 1
ymax = 9
for x in range(max(xmin, sum-ymax), min(xmax, sum-ymin)+1):
print(x, sum-x)
which does run through
6 9
I have the equation
x + y = 15
an I'm looking for solution only in the range x=1..9 and y=1..9, x and y
both integer
Is there a sage-command to do that?
Thanks in advance
Bert Henry
--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To unsubscrib