# Task 2.

In the country of Lemonia, there are only two denominations of money, 7 lemons and 9 lemons. Find all the ways to represent a sum of 997 lemons using these denominations and indicate their quantity.

#
# Solution.

The problem reduces to the equation

$$
7 x+9 y=997
$$

in non-negative integers $x, y$. Let's represent it as $7 x+7 y+2 y=$ $980+14+3$, from which $2 y-3=994-7 x-7 y$. Therefore, $2 y-3$ is divisible by $7,2 y=$ $7 n+3, n \in \mathbb{Z}$. Multiply the equality $2 y=7 n+3$ by 4 and transform the result: $7 y+y=28 n+7+5$, from which $y-5$ is divisible by 7,

$$
y=7 k+5, k \in \mathbb{Z}
$$

From (1), express

$$
\begin{gathered}
x=(997-9 y) / 7=(997-9(7 k+5)) / 7, \\
x=136-9 k, k \in \mathbb{Z}
\end{gathered}
$$

From the conditions $x \geq 0, y \geq 0$ we get

$$
0 \leq k \leq\lfloor 136 / 9\rfloor=15
$$

Thus, the general solution of equation (1) is

$$
x=136-9 k, y=7 k+5, \quad k=0,1, \ldots, 15
$$

There are 16 particular solutions:

if $k=0$, then $x=136, y=5$;

if $k=1$, then $x=127, y=12$;

if $k=15$, then $x=1, y=110$.

Answer: $x=136-9 k, y=7 k+5 \quad k=0,1, \ldots, 15$.