$(x,y) \in \mathbb Z \times\mathbb Z$ with $336x+378y=\gcd(336,378)$
Question: How can I get every possible combination of $x$ and $y$?
My solution so far:
First I have calculated the $\gcd(336,378)=42$. So using that I have $42= 1\cdot378-1\cdot336$
So $x=1$ and $y=-1$.
To get the general formula I have tried two things with gcd and lcm as a factor:
gcd: $42=1 \cdot 42 \cdot x \cdot 378- 1 \cdot 42 \cdot x \cdot 336, x \in \mathbb Z$
lcm: $42=1 \cdot 3024 \cdot x \cdot378 - 1 \cdot 3024 \cdot x, x\in \mathbb Z$
Unfortunately both do not make sense - it was just a guess.
You need to recall the following theorem for the Diophantine equation $ax+by=c$.
In your question, we have $$336x+378y=42,$$ where $\gcd(336,378)=42$. The particular solution is $(x_0,y_0)=(-1,1)$. Thus, $$x=-1+\frac{378}{42}t=-1+9t$$ and $$y=1-\frac{336}{42}t=1-8t$$ where $t\in\Bbb Z$.