Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1997
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1997

[Date Index] [Thread Index] [Author Index]

Search the Archive

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




  • Prev by Date: Re: Symbols, names, objects
  • Previous by thread: Integer Solutions
  • Next by thread: How to solve this?