coin problem with two coins, inductive proof Adjustment This proof is flawed.
I want to ask something about the coin problem with two coins. Let $a,b$ be to numbers in $\mathbb{N} \setminus \{0\}$ (elsewhere I include zero) which have no prime factors in common. I will write
$$
S_{a,b} \quad = \quad a \mathbb{N} + b \mathbb{N}
$$
Now we look for the greatest number $M \in \mathbb{Z}$ that doesn't belong to $S_{a,b}$.
It seems that someone has shown that that $M = ab -a-b$. I didn't know how the proof worked but I wondered if this could be shown by reasoning inductively to product of primes which gives $a$ and $b$. Here below you will find what I tried, I hope that you can help me to finish it.

My attempts
The statement holds if both $a$ and $b$ are empty products, in this case $a=b=1$, so $ab-a-b = -1 $, and every $n \in \mathbb{N}$ can be reached so the equality is true.
Now, if there are are two coprime natural numbers $a,b$ such that 
$$
\max (\mathbb{N} \setminus S_{a,b}) \quad = \quad ab-a-b
$$ 
Then we add a prime factor. Without loss of generality, we can multiply $a$ by a prime number that does not divide $b$. Now we should ask ourselves the following.
$$
\max (\mathbb{N} \setminus S_{pa,b}) \quad \stackrel{?}{=}  \quad pab-pa-b
$$ 
This equality can be split up in the following statements:


*

*$\forall n,m \in \mathbb{N}, \quad pab-pa -b \ \neq \ npa +mb$

*If $ \ k > pab-pa-b \ $ it follows that $k \ = \ n_k a + m_kb$ for some $n_k,m_k \in \mathbb{N }$


To establish the first statement, I remembered that for every combination $n,m \in \mathbb{N}$, we have that $ab-a-b \neq na+mb$. If we multiply by $p$ and add $b(p-1)$ on both sides, we get the $pab-pa-b \ \neq \  mpa + b(na+p-1)$. But I am afraid that this proves anything because the map $n \ \mapsto \  na+p-1$ is doesn't reach every natural number. 
For the second one, I tried to solve $k = mpa + nb$ for $m,n \in \mathbb{N}$. To do this I rewrote
$$
k - m(p-1)a \quad = \quad ma+nb
$$
This would be solvable by the assumption of the induction if the left side is bigger then $ab-a-b$.
We aldready know that $ k > pab -pa -b$. Hence we know
$$
k-m(p-1)a \ > \ pab -pa -b -m(p-1)a \ = \ p(ab-a-ma) + ma -b \ \geq ab-a-b\ 
$$
as we wished. 

I would like to read


*

*If you know how I could end my proof of the first statement

*If I didn't make any mistakes in the proof of the other one.

 A: For the first step: I think it is easier to see what you are doing when we proceed in the other direction. By that I mean, suppose we have $pab - pa - b = npa + mb$ for some $n, m \in \Bbb N$. We want to show that we can then find $n', m' \in \Bbb N$ such that $ab - a - b = n'a + m'b$. You reached the first equation from the second one by scaling by $p$ and translating. Lets try to do that in the other direction:
Take $pab - pa - b = npa + mb$. This is clearly equivalent to $pab - pa - (m + 1) b = npa$. Since $p$ does not divide $b$ but it certainly divides $(m-1)b$, we conclude that it divides $m - 1$. Thus, we have $m - 1 = kp$ for some $k \in \Bbb N$. Dividing our equation by $p$ yields $ab - a - kb = na$. But clearly we can add $(k-1)b$ to get $ab - a - b = na + (k - 1)b$, which gives the desired contradiction (one detail is that since $m + 1$ is positive, we know that $k$ is positive, hence $k - 1$ is non-negative).
I think what I did is similar to your idea, just that in this direction it is easier to see why it works. Your concern about your proof is correct and I don't see how to fix it (without taking the backwards route described above).
For the second step, you probably mean $k > pab - pa - b$ (instead of "$\ge$"). In your proof I don't understand the step "$p(ab−a−ma)+ma−b \ge ab - a - b$. This is definitely not true for all $m$, so how do you choose $m$? Another problem is that in $k−m(p−1)a=ma+nb$ you have the same $m$ on both sides. On the other hand, your proof might give you a different $m$ on the right.
I don't see how to fix you proof (if I find something I will add it here), but I can give another proof for the second part that does not even rely on induction:
Given $k > ab - a - b$, lets try to solve $k = na + mb$. Consider this equation modulo $b$. Since $a$ and $b$ are coprime, we can solve $na \equiv k \bmod{b}$ (this is an elementary but quite important result in number theory). We can further choose $n$ among the residues $\{0, 1, \dots, b - 1\}$.
Then, the congruence tells us that $b \ | \ na - k$, so $na - k = mb$ for some integer $m$. Thus, $na - mb = k$. It suffices to show that $m$ is not positive (then $(n, -m)$ satisfies the desired property). This is clearly the case if $na \le k$.
We see that since $n \le b - 1$, we have $na \le (b-1) a = ab - a < k + b$. We get a problem if $na > k$, hence when $0 < na - k < b$. However, this cannot happen since this would contradict $na \equiv k \bmod{b}$!
So we are done. Please write in the comments if you want some explanations and also if there is an error in what I wrote (I had to figure the proof out myself, so it is definitely possible that something is wrong).
A: So, after finishing the proof of the first part I noticed I forgot about the inductive hypothesis. I'm posting it anyway because there's no rule that says you can't use a non-inductive proof to show the inductive step.
Pretend $a,b \in \mathbb{N}$ are coprime, and suppose $ab - a - b = ma + nb$ for some $m,n \in \mathbb{N}\cup\{0\}$
then we can say $ab = ma + nb$ for $m,n>0$ (new $m$ and $n$ are the old ones plus 1)
then $a(b-m) = ab - ma = nb$
Here we see that both $a$ and $b$ are factors of something strictly less than $ab$, which if they had been coprime, would have been their LCM.
So if $ab - a - b \in S_{a,b}$, $a$ and $b$ aren't coprime.
So by the contrapositive if they are coprime $ab-a-b$ isn't in $S_{a,b}$
and we're done.
