I have to solve this Diophantine equation: $6x+9y=1050$, where $x,y \in\mathbb{N}$. I am not sure as to how to solve this for only the whole numbers, but I think I'm doing it right. I used the extended Euclidean algorithm to get these 2 equations and the $GCF(9,6)$:
$GCF(9,6) = 3$
$3 = 9(1)+6(-1)$
$0 = 9(-2) + 6(3)$
So in order to get the solutions to this equation, I divided the $1050$ with $GCF$ and got $\frac{1050}{3} = 350$ and then inserted it into the equation:
$1050 = 6\cdot350\cdot(-1)+9\cdot350\cdot(-1)$
Therefore, $x = -350$ and $y=350$. But the problem is, I have to solve for $x,y \in\mathbb{N}$, which $x$ is clearly not.
Now I did this step I've found, but I'm unsure if I did this correctly, am I doing this right? Here we go; I multiplied the $0 = 9(-2) + 6(3)$ with $k$ and got: $0 = 9(-2k) + 6(3k)$
I also multiplied the $3 = 9(1) + 6(-1)$ with $350$ and got: $1050 = 9(350)+6(-350)$
then I put them together: $1050 = 9(350-2k) + 6(-350 + 3k)$
And this is where I find the solutions to $x,y$;
$x = -350+3k$ and $y = 350-2k$
Does that mean these two solutions are correct for $x,y \in \mathbb{N}$? Also side question, how can I find the solution, where the sum of $x+y$ is the smallest? I'd appreciate any help whatsoever!