For what values of m does the equation 35530x + 355y = m have integer solutions? For what values of $m$ does the equation $35530x + 355y = m$ have integer solutions?
(only find the $m$'s for which solutions exist)
 A: There is a theorem in number theory which is called Bézout's theorem. It states that if $d=\gcd(a,b)$ then $ax+by=c$ has integer solutions if and only if $d \mid c$. In other words, the linear equation $ax+by=c$ has integer solutions if and only if there exists an integer number like $q$ such that $dq=c$.
I give you a sketch of proof for Bézout's theorem. First, I remind you the definition of $\gcd(a,b)$.
Suppose that $a,b$  are two integers numbers that are not both zero. If $d$ satisfies the following conditions we call $d$ the greatest common divisor of $a$ and $b$ and we write $d=\gcd(a,b)$:


*

*$d>0$

*$d \mid a$ and $d \mid b$

*If there exists another number $c$ such that $c \mid a$ and $c \mid b$ then $c \mid d$


The third condition together with the first condition guarantee that $d$ is uniquely defined. So, it makes sense to talk about the greatest common divisor of $a$ and $b$.
The existence of $\gcd(a,b)$ for $a,b \neq 0 \in \mathbb{Z}$ is far from being obvious. There is a theorem that guarantees the existence of it and it's called Bézout's theorem:
Theorem: If $a,b \neq 0 \in \mathbb{Z}$ then $d=\gcd(a,b)$ exists and satisfies the linear equation $ax_0+by_0=d$ for some $x_0,y_0 \in \mathbb{Z}$.
Sketch of proof for Bézout's theorem: 
Set $S=\{ax+by>0: x,y \in \mathbb{Z} \}$. Show that this set is non-empty. Therefore by using the well-ordering principle, since $S$ is a non-empty subset of $\mathbb{N}$ it must have a minimum element. Let $d=\min{S}$. Then by definition $d>0$, so it satisfies the first condition. 
Now, we have to show that $d \mid a$ and $d \mid b$. Do this by applying Euclid's division theorem this way: divide $a$ by $d$. By Euclid's division algorithm we can find $q,r \in \mathbb{Z}$ such that $a=qd+r$ and $0 \leq r < d$. Show that $r=0$. Do the same for $b$. This proves the second property.
Now, what if $c$ satisfies the first two properties? It means $c \mid a$ and $c \mid b$. Since $d$ is in $S$ it can be written in a particular way. Can you see why $c \mid d$?
After you've proved this theorem then you can easily see that the linear equation $ax+by=c$ has integer solutions if and only if $d \mid c$.
So, in particular, to answer your question, the answer is $m=\gcd(35530,355).k$ for $k \in \mathbb{Z}$. $\gcd(35530, 355)=5$ so $m=5k$ which means $m$ must be a multiple of $5$.
