Highimiy and.

In Anchuria, a day can be either clear, when the sun shines all day, or rainy, when it rains all day. And if today is not like yesterday, the Anchurians say that the weather has changed today. Once, Anchurian scientists established that January 1 is always clear, and each subsequent day in January will be clear only if the weather changed exactly a year ago on that day. In 2015, January in Anchuria was quite varied: sunny one day, rainy the next. In which year will the weather in January first change in exactly the same way as it did in January 2015?
Let's correspond to each January of the year an ordered set $\left(a_{1}, a_{2}, \ldots, a_{31}\right)$ of zeros and ones as follows: if the $k$-th of January is a clear day, then $a_{k}=1$, otherwise $a_{k}=0$. By condition, January 1st is always clear, so $a_{1}=1$. We will correspond to the weather set of the current year

$\left(1, a_{2}, \ldots, a_{31}\right)$ the polynomial $P(x)=1+a_{2} x+\ldots+a_{31} x^{30}$. Then the weather set of the next year will correspond to the remainder $P_{1}(x)$ from dividing the polynomial

$(1+x) P(x)$ by $x^{31}$ (here and below all coefficients of polynomials are considered modulo 2), and after $k$ years the weather is described by the polynomial $P_{k}(x)$, which is the remainder from dividing $(1+x)^{k} P(x)$ by $x^{31}$. Thus, the problem reduces to finding the smallest $k$ for which $P_{k}(x)=P(x)$, that is, $\left((1+x)^{k}-1\right) P(x)$ is divisible by $x^{31}$. It is not difficult to show by induction that $(1+x)^{2^{m}}=1+x^{2^{m}}$. If $2^{m}<31$, then $\left((1+x)^{2^{m}}-1\right) P(x)=x^{2^{m}} P(x)$ is not divisible by $x^{31}$, since the constant term of the polynomial $P(x)$ is one. And $\left((1+x)^{32}-1\right) P(x)=x^{32} P(x)$ is already divisible by $x^{31}$, that is, the number 32 is a period. It remains to note that it will be the smallest, since the smallest period is a divisor of any other, and smaller powers of two are not periods.

## Answer

In the year 2047.