Let $a,b$ be integers with $\gcd(a,b)=1$. What is then the largest integer $N$ which cannot be written as a linear combination with non-negative integer coefficients of $a$ and $b$?
A few days ago, I came up with the following elementary proof.
Because $\gcd(a,b)=1$, the diophantine equation $$ax+by=N$$ has infinitely many solutions if $x,y$ are allowed to be negative. The solutions can be written parametrically as $$x=Nx_0-bt, \ y=Ny_0+at$$ with $t \in \mathbb{Z}$ and $(x_0,y_0)$ satisfying $ax_0+by_0=1$.
The integers $x$ and $y$ must be nonnegative for an attainable number, which we may write as $x,y>-1$, which is equivalent to $$-1/a-Ny_0/a<t<Nx_0/b+1/b$$ The largest $N$ for which this fails satisfies $$(Nx_0/b+1/b)-(-1/a-Ny_0/a)=1$$ whence $$N=ab-(a+b)$$ as desired.
However, I recall reading a much more complicated proof based on complete residue systems in a book on number theory some years ago. Does this alternative proof seem familiar to anyone?