5. In each of the 7 stalls, there is an odd number of horses, and these numbers form a sequence of consecutive odd natural numbers. In each stall, there are fewer than 77 horses. The total number of horses in all 7 stalls is written with digits whose sum is 7. How many horses are there in each of the stalls?
Solution. The sum of any 7 odd numbers is an odd number. The total number of horses is written with a number whose sum of digits is 7, so the sum can end only with one of the digits 1, 3, or 5 (if it ends with 7 or 9, the sum of the digits will be greater than 7). The smallest possible sum of seven consecutive odd numbers is

$$
1+3+5+7+9+11+13=49
$$

with a sum of digits not equal to 7. The largest possible sum of seven consecutive odd numbers less than 77 is

$$
75+73+71+69+67+65+63=483
$$

with a sum of digits not equal to 7. Now, three-digit numbers with a sum of digits 7, greater than 49, and less than 483, with the last digit 1, 3, or 5 are:

$$
115,205,133,223,313,403,151,241,331,421 .
$$

Note that the sum of seven consecutive odd numbers is divisible by 7. Indeed, if a is an odd number, then the sum of seven consecutive odd numbers is:

$$
a+(a+2)+(a+4)+(a+6)+(a+8)+(a+10)+(a+12)=7 a+42=7(a+6)
$$

Of the numbers found, only the number 133 is divisible by 7, so

$$
7(a+6)=133, a+6=19, a=13
$$

Thus, the first number in the desired sequence is 13, and in the stables, the number of horses is given by the sequence $13,15,17,19,21,23,25$.

## VII Department