Problem

Source: 2015 Saudi Arabia IMO TST III p3

Tags: combinatorics, number theory, sum of digits



Find the number of binary sequences $S$ of length $2015$ such that for any two segments $I_1, I_2$ of $S$ of the same length, we have • The sum of digits of $I_1$ differs from the sum of digits of $I_2$ by at most $1$, • If $I_1$ begins on the left end of S then the sum of digits of $I_1$ is not greater than the sum of digits of $I_2$, • If $I_2$ ends on the right end of S then the sum of digits of $I_2$ is not less than the sum of digits of $I_1$. Lê Anh Vinh