given a Diophantine equation $ax+by=k$ for which $k$ values ​have a solution

61 Views Asked by At

given a Diophantine equation $ax+by=k$ and $a,b$ are natural numbers and there $gcd(a,b)=3$ .

for which $k$ values ​​have a solution?

i try do some examples like $3x+3y=2$ and we see that there is no solution.

and for $6x+15y=36$ i found by using euclid algorithm:

$36=5(36-2t)+2(-72+5t)$ and $14<t<18$

but i do not recognize any particular pattern.

I'm sure there is a simple solution that I did not get on it with intuition.

I'd love to see a way to solve problems in this style and a short explanation.

thanks you guys.