Re: Integer Solutions
- To: mathgroup at smc.vnet.net
- Subject: [mg6535] Re: [mg6494] Integer Solutions
- From: penny at suu.edu (Des Penny)
- Date: Mon, 31 Mar 1997 23:01:35 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
>Does anybody know how mmka can give _ALL_ solutions that are Integers??
>I want for example to solve the equation x+y=3 x>0 y>0 and get
>{{3,0}, {2,1}, {1,2}, {0,3}}
>Jason.
Hi:
The following will work:
eqn= x+y==3;
sol=Solve[eqn,y];
Table[{x,y} /. sol[[1]],{x,0,3,1}]
Cheers,
Des Penny
-------------------------------
Des Penny
Physical Science Dept.
Southern Utah University
Cedar City, UT 84720
VOICE: (Office): (801) 586-7708
(Home) : (801) 586-2286
FAX: (801) 865-8051
e-mail: penny at suu.edu
-------------------------------