![]() Volume 9, Issue 2 Articles Tricks of the Trade In and Out Trott's Corner New Products New Publications Calendar News Bulletins New Resources Classifieds Download This Issue Editorial Policy Staff Submissions Subscriptions Advertising Back Issues Contact Information |
In and Out
Integer Solutions Q: Is there a simple way to compute the solutions to A: Adam Strzebonski (adams@wolfram.com) answers: In Version 5, you can use Reduce, though it requires changing the value of a system option. By default, Reduce writes out integer solutions of
Otherwise, the solutions are represented as
Here is the general parametric solution to the given problem with
Changing the value of a Reduce system option yields explicit solutions.
Here are all the solutions to the given problem with
Although this approach is simplest in that it requires just a single command and no manual preprocessing of the input, it is not very efficient. Reduce has no special methods for solving equations and inequalities over the primes, other than by generating primes in a given finite interval. If we give the problem to Reduce directly, it uses a general method for solving systems of equations and inequalities over the integers, and then removes the numeric solutions that are not prime. Changing the system options causes A more efficient way of solving this particular problem is to make Reduce generate only prime values for
Here is a comparison of the two methods.
|
||||||||
About Mathematica | Download Mathematica Player Copyright © 2004 Wolfram Media, Inc. All rights reserved. |