Skip to main content
1-Visitor
September 26, 2017
Question

Diophantic linear Equations

  • September 26, 2017
  • 1 reply
  • 4398 views

Good morning to all,

currently i'm dealing with the theory of numbers where i have to find the solutions of a linear diophantic equation in common.

Is there any way in MP4 to call up a function for this problem, does there exist an implemented function in Prime for this?

Thanks in Advance

Volker

1 reply

21-Topaz II
September 26, 2017

The simplest linear Diophantine equation takes the form

ax + by = c,

where a, b and c are given integers, x, y — unknowns.

The solutions are completely described by the following theorem: This Diophantine equation has a solution (where x and y are integers) if and only if c is a multiple of the greatest common divisor of a and b. Moreover, if (x, y) is a solution, then the other solutions have the form (x + kv, y - ku), where k is an arbitrary integer, and u and v are the quotients of a and b (respectively) by the greatest common divisor of a and b.To find the solution one can use Extended Euclidean algorithm (except for a = b = 0 where either there are unlimited number of solutions or none).

 

Mathcad has a gcd function that will determine greatest common divisor.  gcd(a,b)

You can determine if c is a multiple by testing the mod function for zero return. mod(c,gcd(a,b))=0 is pass

You could program to search for them.

 

 

 

vlehner1-VisitorAuthor
1-Visitor
September 26, 2017

So in summary i have to programm a routine because of the fact that there is no special function in MP4 for this.

THX anyway.

 

1-Visitor
September 27, 2017

@vlehner wrote:

So in summary i have to programm a routine because of the fact that there is no special function in MP4 for this.

THX anyway.

 


File in Mathcad Prime 3.1 format attached.

Diophantine.png