Why this approach works for solving USAMTS's number theory problem?

63 Views Asked by At

This is the first problem of USAMTS $1998$ Round $1$

Several pairs of positive integers $(m ,n )$ satisfy the condition $19m + 90 + 8n = 1998$. Of these, $(100, 1 )$ is the pair with the smallest value for $n$. Find the pair with the smallest value for $m$.

Users on AOPS solved it with different approaches here. This is @RedFireTruck's answer:

$$(100-8\lfloor\frac{100}8\rfloor,1+19\lfloor\frac{100}8\rfloor)=(4,229)$$

I don't understand why this approach works. It seems they used the fact that $(100,1)$ is a pair with smallest $n$ then subtracted $8\lfloor\frac{100}8\rfloor$ from the first number and added $19\lfloor\frac{100}8\rfloor$ to second one to get the result. Can you please explain how it works?

1

There are 1 best solutions below

0
On BEST ANSWER

Consider the Diophantine equation $ax+by=c$.
If $\gcd(a,b)=1$ and if one of the solution is $(x_0,y_0)$, then the general solution is given by $(x_0+bk,y_0-ak)$

Proof

Let $i$ be the smallest positive integersuch that $x_0+i$ satisfies the Diophantine equation.
Let the solution pair be $(x_0+i,y_0-j)$.
We have $ax_0+ai+by_0-bj=c$
$\implies ai=bj$.
$i$ is minimum when $i=b$.$\implies j=a$
$(x_0+b,y_0-a)$ is the solution which has the smallest value of $x$ greater than $x_0$.
Continuing the same way we can prove that $(x_0+bk,y_0-ak)$ is the general solution