## Task A-1.5.

In a circle, 2023 people are sitting. Among them, $N$ people always tell the truth, while all others always lie. Everyone has made the statement: "Both people sitting next to me are lying." Determine all values of the number $N$ for which this is possible.
## Solution.

We will prove that $N$ can take any value from the set

$$
\{675,676, \ldots, 1010,1011\}
$$

From the conditions of the problem, both people sitting next to a person who tells the truth necessarily lie. On the other hand, next to each person who lies, there is at least one person who tells the truth.

In particular, out of two people sitting next to each other, at least one lies (otherwise, both of these people would have a neighbor who tells the truth), and out of three people in a row, at least one tells the truth (otherwise, the middle person in this row would have two neighbors who lie).

Obviously, in the circle, there is at least one person who tells the truth and at least one person who lies.

Consider one person who tells the truth. Divide the other 2022 people into 674 groups of three consecutive people. In each such group, at least one person tells the truth (otherwise, we would have three consecutive people who lie). Therefore, the number of people $N$ who tell the truth is at least $1+674=675$.

Now consider one person who lies, and divide the other 2022 people into 1011 pairs of adjacent people. In each pair, at least one person lies (otherwise, we would have two consecutive people who tell the truth). Therefore, the number of people $N$ who tell the truth is at most 1011.

Thus, we have proven that it is necessary that $675 \leqslant N \leqslant 1011$. We will now prove that for each of these choices of $N$, we can find a suitable arrangement of people in the circle.

Let some seven people in the circle satisfy ILLILIL, where the letter I denotes a person who tells the truth, and L a person who lies. Divide the remaining 2016 people into $K$ groups of six consecutive people of the form $I L I L I L$ and $336-K$ groups of the form $I L L I L L$.

Each such configuration indeed satisfies the conditions of the problem: next to each person who tells the truth, there is a person who lies, and next to each person who lies, there is at least one person who tells the truth (including the people who come at the end of the six-person group, since after them will come a row of people starting with a person who tells the truth).

The number of people who tell the truth is then

$$
N=3+K \cdot 3+(336-K) \cdot 2=675+K
$$

Since the number $K$ can take any value from the set $\{0,1, \ldots, 336\}$, we have constructed configurations of people in which the number of people who tell the truth takes every value from the set $\{675,676, \ldots, 1010,1011\}$, which is what we needed to prove.

Note: The solution follows the following scoring scheme: 1 point for the correct set of values of $N$, 6 points for proving that $N$ must be in that set, and 3 points for constructing such groups of people for each $N$.

It is possible to prove the following statement: between any two consecutive people who tell the truth (between whom there is no third person who tells the truth), there is one or two people who lie. The statement and proof of this claim are worth 1 point (which corresponds to the second point of the above scheme).

For the last 3 points, it is not enough to give an example of people for the edge cases $N=675$ and $N=1011$, but also for all in between. The construction for these edge cases is worth 1 point each, and a clear and unambiguous description of the construction for all other cases is worth 1 point. These three points do not add to the last 3 points in the above scoring scheme.

## COUNTY COMPETITION IN MATHEMATICS

## 2nd grade - high school - A variant

1. March 2023.

## IF A STUDENT HAS A DIFFERENT APPROACH TO SOLVING THE PROBLEM, THE COMMITTEE IS OBLIGED TO SCORE AND EVALUATE THAT APPROACH APPROPRIATELY.