Let $a$ and $b$ same sign, $a,b\in \mathbb{Z}$ and $n\in\mathbb{N}$. Prove that $\exists c$ that the equation $ax+by=c$ has exactly n different positive solutions, it means $(x,y)$, where $x>0$ and $y>0$.
I have to use theorem:
Let $a,b,c\in\mathbb{Z}$. If at least one of the numbers $a$ and $b$ is not $0$ and $x_0, y_0$ is the equation $ax+by=c$ some solution, then all solutions $x,y$ of this equation is obtained by means of formulas
$x=x_0+\frac{b}{gcd(a,b)}t$,
$y=y_0-\frac{a}{gcd(a,b)}t$,
giving all integer values to the variable $t$.
First find a solution $x_0,y_0$ and then suitable $c$ value.
How to prove it?
Thank You.
Let $d=\gcd(a,b)$ and $a'=a/d$, $b'=b/d$. Then
$x = x_0 + b't >0$ iff $t > -x_0/b'$
$y = y_0 - a't <0$ iff $t < y_0/a'$.
So, $t \in (-x_0/b', y_0/a')$. The length of this interval is $$ \frac{y_0}{a'}+\frac{x_0}{b'}=\frac{a'x_0+b'y_0}{a'b'}=\frac{c}{a'b'd}=\frac{c}{m} $$ where $m=lcm(a,b)$. Take $c=nm$ and the interval will have length $n$ and so $n$ integers inside it in general. If one or both extremes are integers, you'll have to compensate.