Mangara / diophantine

Solve linear and quadratic diophantine equations in two variables: Ax^2 + Bxy + Cy^2 + Dx + Ey + F = 0
Apache License 2.0
3 stars 0 forks source link

Speed up congruence solver #1

Open Mangara opened 2 years ago

Mangara commented 2 years ago

While congruences can be quickly brute-forced for small n, some of the transformations of even quadratic equations with small coefficients generate congruences with n in the hundred-thousands. In these cases, it would be better to use a faster algorithm.

Even just factoring the modulus, solving the smaller congruences and combining the result may help.

These sources may be helpful:

Mangara commented 2 years ago

Once this is done, we can stop skipping test equation 19 ( $42x^2 + 8xy + 15y^2 + 23x + 17y - 4915 = 0$ ).