This seemingly simple question has really stumped me:
How do I prove that the largest integer that can't be represented with a non-negative linear combination of the integers $m, n$ is $mn - m - n$, assuming $m,n$ are coprime?
I got as far as this, but now I can't figure out where to go:
$mx + ny = k$, where $k = mn - m - n + c$, for some $c > 0$
$\Rightarrow m(x + 1) + n(y + 1) = mn + c$
If I could only prove this must have a non-negative solution for $x$ and $y$, I'd be done... but I'm kind of stuck.
Any ideas?
Here's an alternative (but perhaps more pedestrian) proof:
(a) $mn-m-n$ is not a non-negative linear combination: Assume, to the contrary, that $mn-m-n=am+bn$ with $a,b\in\mathbb N_0$. Then $$(a+1)m+bn=mn-n=(m-1)n$$ $$(a+1)m = (m-1-b)n$$ But $(a+1)m$ is clearly positive and since $(a+1)m < mn-n < mn$, it is a positive number less than $mn$ that is a multiple of both $m$ and $n$, contradicting the assumption that that $m$ and $n$ are coprime.
(b) Every integer $k>mn-m-n$ is a non-negative linear combination. The $m$ numbers $0$, $n$, $2n$, ..., $(m-1)n$ represent all the different residue classes modulo $m$, so one of them must be congruent to $k$ modulo $m$. So $k=am+bn$ where $0\le b<m$, and we need to check that $a$ is non-negative. However, if $a$ is negative, $am+bn$ can be at most $(m-1)n-m = mn-m-n$.