MathDB
Numbers on the board

Source: Greece Junior National Olympiad 2022, Problem 3

February 26, 2022
combinatorics

Problem Statement

On the board we write a series of nn numbers, where n40n \geq 40, and each one of them is equal to either 11 or 1-1, such that the following conditions both hold:
(i) The sum of every 4040 consecutive numbers is equal to 00. (ii) The sum of every 4242 consecutive numbers is not equal to 00.
We denote by SnS_n the sum of the nn numbers of the board. Find the maximum possible value of SnS_n for all possible values of nn.