Problem 7.8. Carlson and Little Man have several jars of jam, each weighing an integer number of pounds.

The total weight of all the jars of jam that Carlson has is 13 times the total weight of all the jars that Little Man has. Carlson gave Little Man the jar with the smallest weight (from those he had), after which the total weight of his jars turned out to be 8 times the total weight of Little Man's jars.

What is the maximum number of jars of jam that Carlson could have had initially?
Answer: 23.

Solution. All variables in the solution will be natural numbers, since the weights of all jars are integers by condition.

Let Little have a total of $n$ pounds of jam initially, then Karlson had $13 n$ pounds of jam. Let Karlson give away his smallest jar with $a$ pounds of jam. Then, by condition, $13 n-a=8(n+a)$, i.e., $5 n=9 a$. Therefore, $9 a$ is divisible by 5, which means $a$ is divisible by 5, i.e., $a=5 k$ for some $k$. Then $5 n=9 \cdot 5 k$, and $n=9 k$. Consequently, initially, Karlson had several jars with a total of $13 \cdot 9 k=117 k$ pounds of jam, with the smallest jar weighing $5 k$ pounds. But then the number of jars Karlson had is no more than $\frac{117 k}{5 k}=23.4$. Therefore, there are no more than 23 jars.

Karlson could have had 23 jars. For example, let him have 1 jar weighing 7 pounds and 22 jars weighing 5 pounds each, and Little have 1 jar weighing 9 pounds. Then all conditions are met: $117=13 \cdot 9$ and $117-5=8 \cdot(9+5)$.

## 8th grade