Congruum

Author

Eric W. Weisstein
August 23, 2011

This notebook downloaded from http://mathworld.wolfram.com/notebooks/DiophantineEquations/Congruum.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/Congruum.html.

©2011 Wolfram Research, Inc. except for portions noted otherwise

Enumerate

(l1=Select[Union[Flatten[Table[4 x^3 y-4 x y^3,{x,100},{y,100}]]],0<#<10000&])//Timing

Reduce[h==a^2-x^2==x^2-b^2&&0<h<30&&a>0&&b>0&&x>0,{a,b,x,h},Integers]

Reduce[h==a^2-x^2==x^2-b^2&&0<h<30&&a>0&&b>0&&x>0,h,Integers]

Reduce[h==a^2-x^2==x^2-b^2&&0<h<100&&a>0&&b>0&&x>0,h,Integers]//Timing

Reduce[h==a^2-x^2==x^2-b^2&&0<h<1000&&a>0&&b>0&&x>0,h,Integers]//Timing

Reduce[h==a^2-x^2==x^2-b^2&&0<h<10000&&a>0&&b>0&&x>0,h,Integers]//Timing

Reduce[n==4 x^3 y-4 x y^3&&0<n<100&&x>0&&y>0,n,Integers,Backsubstitution->True]//Timing

Reduce[n==4 x^3 y-4 x y^3&&0<n<1000&&x>0&&y>0,n,Integers,Backsubstitution->True]//Timing

(solns2=Reduce[n==4 x^3 y-4 x y^3&&0<n<10000&&x>0&&y>0,n,Integers,Backsubstitution->True])//Timing

l2=Union[Join[n/.Rest[{ToRules[solns2]}]],Table[4x(x^2-1),{x,2,13}]]

Complement[l1,l2]

Complement[l2,l1]

Most Efficient

(sol=Solve[0<4x^3y-4x y^3<10^4&&x>y>0,{x,y},Integers];)//Timing

Union[4x^3y-4x y^3/.sol]//Short

"DiscreteSolutionBound"/.("ReduceOptions"/.SystemOptions["ReduceOptions"])

SetSystemOptions["ReduceOptions"->"DiscreteSolutionBound"->10^10];

(sol=Solve[0<4x^3y-4x y^3<10^4&&x>y>0,{x,y},Integers];)//Timing

Union[4x^3y-4x y^3/.sol]//Short

(sol=Solve[0<4x^3y-4x y^3<10^10&&x>y>0,{x,y},Integers];)//Timing

Union[4x^3y-4x y^3/.sol]//Short