Skip to main content
OlympiadHQ

Browse · MathNet

Print

59th Ukrainian National Mathematical Olympiad

Ukraine counting and probability

Problem

Andrii chooses a sign in front of each number in the expression . How many different positive values can Andrii obtain as a result of the computed expression?
Solution
Clearly, the expression cannot equal , since it contains odd numbers. We want to show that the expression can be any odd number between and .

Take some configuration. Find the first from the left consecutive numbers with signs "-" and "+". The switching of these signs decreases the value of the expression by . We will start with the following expression: "+1+2+3+\dots+2018" and will change it to expression "-1+2+3+\dots+2018" that is less by as described above. By following the described algorithm, we will obtain all the numbers decreased by .

When we get the expression

+1 - 2 - 3 - ... - 2018, for which the algorithm doesn't work, the last step will be to switch to the smallest expression -1 - 2 - 3 - ... - 2018.
Final answer
1018586

Techniques

Invariants / monovariantsSums and products