N6. Let $a>b>1$ be relatively prime positive integers. Define the weight of an integer $c$, denoted by $w(c)$, to be the minimal possible value of $|x|+|y|$ taken over all pairs of integers $x$ and $y$ such that
$$
a x+b y=c .
$$

An integer $c$ is called a local champion if $w(c) \geq w(c \pm a)$ and $w(c) \geq w(c \pm b)$.
Find all local champions and determine their number.
Solution. Call the pair of integers $(x, y)$ a representation of $c$ if $a x+b y=c$ and $|x|+|y|$ has the smallest possible value, i.e. $|x|+|y|=w(c)$.
We characterise the local champions by the following three observations.

Lemma 1. If $(x, y)$ a representation of a local champion $c$ then $x yx$; this is a contradiction.
If $x, y \leq 0$ then we can switch to $-c,-x$ and $-y$. $\square$
From this point, write $c=a x-b y$ instead of $c=a x+b y$ and consider only those cases where $x$ and $y$ are nonzero and have the same sign. By Lemma 1 , there is no loss of generality in doing so.
Lemma 2. Let $c=a x-b y$ where $|x|+|y|$ is minimal and $x, y$ have the same sign. The number $c$ is a local champion if and only if $|x|0$.
The numbers $c-a$ and $c+b$ can be written as
$$
c-a=a(x-1)-b y \quad \text { and } \quad c+b=a x-b(y-1)
$$
and trivially $w(c-a) \leq(x-1)+y0$. We prove that we can choose $k=1$.
Consider the function $f(t)=|x+1-b t|+|y-a t|-(x+y)$. This is a convex function and we have $f(0)=1$ and $f(k) \leq 0$. By Jensen's inequality, $f(1) \leq\left(1-\frac{1}{k}\right) f(0)+\frac{1}{k} f(k)b$, we also have $0<y<a$. Then
$$
w(c+a) \leq|x+1-b|+|y-a|=a+b-1-(x+y) \leq x+y=w(c)
$$
and
$$
w(c-b) \leq|x-b|+|y+1-a|=a+b-1-(x+y) \leq x+y=w(c)
$$
therefore $c$ is a local champion indeed.
Lemma 3. Let $c=a x-b y$ and assume that $x$ and $y$ have the same sign, $|x|<b,|y|<a$ and $|x|+|y|=\left\lfloor\frac{a+b}{2}\right\rfloor$. Then $w(c)=x+y$.
Proof. By definition $w(c)=\min \{|x-k b|+|y-k a|: \quad k \in \mathbb{Z}\}$. If $k \leq 0$ then obviously $|x-k b|+|y-k a| \geq x+y$. If $k \geq 1$ then
$$
|x-k b|+|y-k a|=(k b-x)+(k a-y)=k(a+b)-(x+y) \geq(2 k-1)(x+y) \geq x+y .
$$

Therefore $w(c)=x+y$ indeed.
Lemmas 1,2 and 3 together yield that the set of local champions is
$$
C=\left\{ \pm(a x-b y): 0<x<b, x+y=\left\lfloor\frac{a+b}{2}\right\rfloor\right\} .
$$

Denote by $C^{+}$and $C^{-}$the two sets generated by the expressions $+(a x-b y)$ and $-(a x-b y)$, respectively. It is easy to see that both sets are arithmetic progressions of length $b-1$, with difference $a+b$.

If $a$ and $b$ are odd, then $C^{+}=C^{-}$, because $a(-x)-b(-y)=a(b-x)-b(a-y)$ and $x+y=\frac{a+b}{2}$ is equivalent to $(b-x)+(a-y)=\frac{a+b}{2}$. In this case there exist $b-1$ local champions.
If $a$ and $b$ have opposite parities then the answer is different. For any $c_{1} \in C^{+}$and $c_{2} \in C^{-}$,
and
$$
\begin{array}{c}
2 c_{1} \equiv-2 c_{2} \equiv 2\left(a \frac{a+b-1}{2}-b \cdot 0\right) \equiv-a \quad(\bmod a+b) \\
2 c_{1}-2 c_{2} \equiv-2 a \quad(\bmod a+b) .
\end{array}
$$

The number $a+b$ is odd and relatively prime to $a$, therefore the elements of $C^{+}$and $C^{-}$belong to two different residue classes modulo $a+b$. Hence, the set $C$ is the union of two disjoint arithmetic progressions and the number of all local champions is $2(b-1)$.
So the number of local champions is $b-1$ if both $a$ and $b$ are odd and $2(b-1)$ otherwise.

Comment. The original question, as stated by the proposer, was:
(a) Show that there exists only finitely many local champions;
(b) Show that there exists at least one local champion.