Maths Diophantine Equation

JavaScript could solve Diophantine equations. (Equations to be solved in integers.) Search down the table of contents to see different forms.

ax+by=c


function gcd(a,b) {
while(a!=b){
while (a>b) {
a=a-b*Math.floor(a/b);
}
while (a<b) {
b=b-a*Math.floor(b/a);
}
}
return a;
}
 
function type1(a,b,c) {
if (Math.floor(c/gcd(a,b))!=c/gcd(a,b)) {
alert("No solutions.");
}
}

ax+by+cz=d


ax+by+cz=d, ex+fy+gz=h


Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License