[Maxima] find integer
andrej.vodopivec at gmail.com
Wed Jan 11 03:31:29 CST 2012
On Tue, Jan 10, 2012 at 6:00 PM, Raymond Toy <toy.raymond at gmail.com> wrote:
> On Sat, Jan 7, 2012 at 5:29 AM, Hans W. Hofmann <hawe at chefmail.de> wrote:
>> I want to find values x to make
>> p1 and p2 integer. How to do this in maxima?
> Not sure if this is the best approach, but here is one way.
> This gives two equations for x. Make them equal so we get an equation in p1
> and p2, where p1 and p2 are integers. This is a Diophantine equation. A
> Google search shows that someone posted a Diophantine equation solver, but I
> can't find the code right now. If I do it by hand, I get x = 44*r+64, where
> r is any integer. This gives p1 = 16*r+4 and p2 = 35*r+10.
There is a solve_lde function in the discrete package
(%i2) eliminate([p1=-(4*x-300)/11,p2=-(35*x-1800)/44], [x]);
(%i4) subst(%, [p1=-(4*x-300)/11,p2=-(35*x-1800)/44]);
(%i5) solve(%, x);
(of course %k1 is an integer)
More information about the Maxima