1

I know how to find solutions for linear Diophantine equations like $ax-by=c$, but is there a shortcut when I already know that (a,b,c) are mutually prime?

Even if there isn't a conceptual shortcut, is there a nicer or briefer way to describe the algorithm in this special case?

Joe Slater
  • 440
  • 2
  • 10

1 Answers1

2

Only $a$ and $b$ have to be coprime to ensure there are solutions. You begin with solving $u_oa+v_0b=1$ (Bézout's identity) with the extended Euclidean algorithm. Then $$x_0=cu_0,\quad y_0=-cv_0$$ is a solution.

As all solution to Bézout's identity are $$x=x_0+kb,\quad y=y_0-ka\quad(k\in\mathbf Z),$$ all solutions of the given equation have the form $$x=x_0+kb, \quad y=y_0+ka.$$

Bernard
  • 175,478