Task 1. Boys and girls formed a circle in such a way that the number of children whose right neighbor is of the same gender is equal to the number of children whose right neighbor is of a different gender. What could be the total number of children in the circle?
Solution. Let $n$ be the number of children next to whom stands a child of the opposite gender, and $m$ be the number of children next to whom stands a child of the same gender. Initially, $n=m$, i.e., the total number of children ($n+m$) is even. We will swap the positions of two adjacent children so that all boys gather in a row on one side of the circle, and all girls on the other. Then $n$ will become 2. With each such swap of children, the numbers $n$ and $m$ either do not change, or one increases by 2, and the other decreases by 2. This means that the remainder of the division of the difference ($m \sim n$) by 4 does not change.

Initially, this remainder was 0.

If the total number of children is $2k$, $n=2$, then $m=2k \curlyvee 2$. Then $m^{\llcorner} n=2k^{\llcorner} 4$.

For the remainder of the division of $m^{\llcorner} n$ by 4 to be zero, $k$ must be divisible by 2. That is, the total number of children must be a multiple of 4.

Answer. Any natural number that is a multiple of four.