cancel
Showing results for
Did you mean:
cancel
Showing results for
Did you mean:

Level 11

## Diophantic linear Equations

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?

Volker

Volker
6 REPLIES

## Re: Diophantic linear Equations

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.

Highlighted

## Re: Diophantic linear Equations

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.

Volker

## Re: Diophantic linear Equations

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

Viktor

спасибо виктор,

In Mathacd 11:

Luc

## Re: Diophantic linear Equations

Thanks Victor and Werner.

I tryed to run isolve() in MC15, and it will not work. Is it possible to run this function in MC15?

I have not the good old MC11.

Volker

## Re: Diophantic linear Equations

No, isolve not work in MC15. It was an undocumented symbolics command in Mathcad 11.

Viktor
Announcements

____________________________________ If you experience problems when attaching a Mathcad sheet file ( .mcd, .xmcd or .mcdx) to the message then zip it first. To get the .zip file, use Windows Explorer, select the sheet file, right-mouse click and select "Send to" then "Compressed (zipped) folder". This results in a .zip file containing the worksheet that you can attach