I am trying to prove the following:
Given $a, b \geq 1$ with gcd$(a,b)=1$. Denote $A:= \{ma+nb$ | $m,n\geq 0\}$. Prove that there exists a largest integer, as a function of $a,b$, such that it cannot be written as an integer in $A$.
There are several posts on this (e.g., here), but it seems that they all start off with the a proiri knowledge of the required integer. They also seem 'unnatural' to me, in the sense that all of the steps are 'polished' and it is not clear what led the writer to choose them. So I have been trying to do this myself, but cannot seem to complete the proof.
Here is my attempt:
We could state the problem in other words: we are looking for the smallest integer in $A$, denoted $z$, such that for all $k \in \mathbb{N}$ we have $z+k \in A$. So:
$$z = \min_{m_z, n_z} \{m_za+n_zb\quad |m_z, n_z \geq 0 \quad \wedge \quad m_za+n_zb+k \in A \quad \forall k\in \mathbb{N}\}$$
Since gcd$(a,b)=1$ we can write $k=km_0a+kn_0b$ for some integers $m_0, n_0$ (not necessarily both $\geq 0$).
This means that:
$$m_za+n_zb+k = (m_z+km_0)a + (n_z+kn_0)b$$
and therefore we can replace this term in $z$ and write:
$$z = \min_{m_z, n_z} \{m_za+n_zb\quad |m_z, n_z \geq 0 \quad \wedge \quad (m_z+km_0)a + (n_z+kn_0)b \in A \quad \forall k\in \mathbb{N}\}$$
In order for the second requirement to hold, i.e.: $\quad(m_z+km_0)a + (n_z+kn_0)b \in A \quad \forall k\in \mathbb{N}\quad$ we need that for all $k \in \mathbb{N}$:
$$m_z+km_0\geq 0$$ $$n_z+kn_0\geq 0$$
and, along with the first requirement we require that for all $k \in \mathbb{N}$:
$$m_z \geq \max\{-km_0, 0\}$$ $$n_z \geq \max\{-kn_0, 0\}$$
At this point I wasn't sure what to make of this, so I plugged in a toy example with $a=5, b=7$. We can see that: $m_0=-4, n_0 = 3$, which means that we require that for all $k \in \mathbb{N}$:
$$m_z \geq \max\{4k, 0\}$$ $$n_z \geq \max\{-3k, 0\}=0$$
But the first one seems to lead to the conclusion that no such $m_z$ exists...? What went wrong here? And how could I go about proving this in a way that describes how the integer was discovered?
Any help much appreciated!