Ask Your Question

Revision history [back]

Equation problem

I have the equation x + y = 15 and 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?

I tried it with var('x, y') assume(x,"integer") assume(x>0) assume(y, "integer") assume(y>0) solve(x+y==15,x,y)

The result was (t_0, -t_0 + 15) obviously right, but not 6,9 7,8 8,7 and 9,6

Thanks in advance Bert Henry

click to hide/show revision 2
None

Equation problem

I have the equation equation

x + y = 15

and 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?

I tried it with with

var('x, y')
assume(x,"integer")
assume(x>0)
assume(y, "integer")
assume(y>0)
solve(x+y==15,x,y)

solve(x+y==15,x,y)

The result was was

(t_0, -t_0 + 15)

obviously right, but not 6,9 7,8 8,7 and 9,6

Thanks in advance Bert Henry