Re: Simplifying with assumptions
- To: mathgroup at smc.vnet.net
- Subject: [mg49010] Re: Simplifying with assumptions
- From: "Dana DeLouis" <delouis at bellsouth.net>
- Date: Mon, 28 Jun 2004 04:14:00 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
This should work, but it returns an error: FindInstance[Sqrt[48 - n^2 + 8*x] == k, n, x, k}, Integers, 1] The methods available to FindInstance are insufficient to find the requested \ instances or prove they do not exist. However, it can find two. Go figure! FindInstance[Sqrt[48 - n^2 + 8*x] == k, {n, x, k}, Integers, 2] {{n -> -500, x -> 31244, k -> 0}, {n -> 72, x -> 642, k -> 0}} It also won't work without adding n > x, or n < x for some unknown reason. You would think that this would work, but it doesn't. FindInstance[k > 0 && n > x && k == Sqrt[48 - n^2 + 8*x], {n, x, k}, Integers, 5] The methods available to FindInstance are insufficient to find the requested \ instances or prove they do not exist. You then have to remember the "Huge" bug in the program where order of variables make a difference. So, instead of {n, x, k}, try {k, n, x} FindInstance[k > 0 && n > x && k == Sqrt[48 - n^2 + 8*x], {k, n, x}, Integers, 5] { {k -> 2, n -> -2, x -> -5}, {k -> 2, n -> 6, x -> -1}, {k -> 2, n -> 10, x -> 7}, {k -> 4, n -> 0, x -> -4}, {k -> 4, n -> 4, x -> -2}} HTH Dana $Version "5.0 for Microsoft Windows (June 10, 2003)" = = = = "Mietek Bak" <mietek at icpnet.pl> wrote in message news:cbgjae$cef$1 at smc.vnet.net... > Hello, > > I'm a complete newcomer to Mathematica, so please excuse this possibly > silly question. > > I'm trying to determine if a formula will ever give an integer result, > assuming that all variables used in it are integer. I've been searching > through the built-in documentation, but my best guess didn't really do > anything: > > Simplify[Element[Sqrt[48 - n^2 + 8*x],Integers],Element[{n, x},Integers]] > > It would be best if I could somehow determine the set of combinations of > variables that would give an integer result -- if there are any. Is > there a way to do that in Mathematica? > > Thanks in advance, > Mietek Bak.