Aeexeев B.5. A machine produces parts of two types. On the conveyor belt, 75 parts are laid out in a single line. While the conveyor is moving, the machine prepares a part of the type that is less represented on the belt. Every minute, the next part falls off the belt, and the prepared part is placed at its end. After some number of minutes from the start of the conveyor, it may happen that the arrangement of parts on the belt first repeats the initial one. Find a) the smallest such number, b) all such numbers.
Let after $t$ minutes, there are $m(t)$ parts of type $A$ and $k(t)$ parts of type $B$ on the conveyor belt. Since $m(t)$ and $k(t)$ have different parities, $|m(t)-k(t)|$ can only take values $1, 3, 5, \ldots$ Since each minute a part of the type that is less on the conveyor belt is added, and a random part is removed, $|m(t)-k(t)|$ either remains unchanged or decreases. Since, by the condition, the initial arrangement repeats after some number $n$ minutes (and thus after $2n, 3n$, etc.), we get that the value $|m(t)-k(t)|$ does not change for all $t$.

Suppose that $|m(t)-k(t)| \geq 3$. Since $|m(t)-k(t)|$ does not change, and $m(t)$ and $k(t)$ can only change by 1, then $m(t)$ and $k(t)$ also do not change. Then, a part of the same type is always added and a part of the same type is always removed. Thus, initially, all parts on the conveyor belt are of the same type, and a part of the same type is added. But this contradicts the rule for preparing the next part. Therefore, $|m(t)-k(t)|=1$ for all $t$.

Let $a_{1}, \ldots, a_{75}, a_{76}, a_{77}, \ldots$ be the types of parts ($A$ or $B$) that were initially on the conveyor belt and were added at subsequent moments. We have shown that for any $i$, among $a_{i+1}, \ldots, a_{i+75}$, $A$ appears 38 times and $B$ appears 37 times, and then $a_{i+76}=B$, or vice versa. In any case, for each $i$, among $a_{i+1}, \ldots, a_{i+76}$, $A$ and $B$ each appear 38 times.

Since among $a_{i}, \ldots, a_{i+75}$, $A$ and $B$ each appear 38 times, and among $a_{i+1}, \ldots, a_{i+76}$, $A$ and $B$ each appear 38 times, then $a_{i+76}=a_{i}$ (for each $i$). Thus, 76 is the period of the sequence $a_{1}, a_{2}, \ldots$

Let after $n$ minutes, the situation on the conveyor belt repeats for the first time. Then $n$ is the period of the sequence $a_{1}, a_{2}, \ldots$ Conversely, if $q$ is the period of this sequence, then after $q$ minutes, the situation on the conveyor belt repeats. Therefore, $n$ is the minimal period of the sequence $a_{1}, a_{2}, \ldots$

The minimal period is a divisor of any period. Therefore, 76 is divisible by $n$. Since on any segment of length 76, parts $A$ and $B$ appear the same number of times, this is also true for a period of length $n$. Hence, $n$ is even. The remaining options are $n=2, 4, 38, 76$.

Let $n=2k$ and 76 is divisible by $n$. Construct an infinite sequence where $A$ appears $k$ times, then $B$ appears $k$ times, and then everything repeats with a period of $2k$. This sequence will be generated in our problem if the initial arrangement of parts on the conveyor belt is the first 75 elements of the sequence, and the initial situation will repeat for the first time exactly after $2k$ minutes. Thus, all values $n=2, 4, 38, 76$ can be realized.

## Answer

a) $2$; b) $2, 4, 38, 76$