Find the biggest natural number $n$ so there's an array of $n$ real numbers such that the sum of every three consecutive numbers is negative and...

Find the biggest natural number $n$ so there's an array of $n$ real numbers such that the sum of every three consecutive numbers is negative and the sum of every five consecutive numbers is positive.

I'm pretty sure we have to take an array of $x$ numbers and prove a contradiction by proving that it's impossible that one of the sums of five consecutive numbers can't be positive, but I haven't figured out anything useful and I'm afraid I'm wasting time on the wrong approach. Any help's appreciated.


Solution 1:

You can't do seven (or more) because

$$(a+b+c+d+e)+(b+c+d+e+f)+(c+d+e+f+g)=(a+b+c)+(b+c+d)+(c+d+e)+(d+e+f)+(e+f+g)$$

but you can do six, for example $(-10,19,-10,-10,19,-10)$.

Solution 2:

The trick is to define $s_i$ as the sum of the first $i$ numbers, i.e. $s_0 = 0$, $s_1 = a_1$, $s_2 = a_1 + a_2$, etc.

The required properties translate to $s_i > s_{i + 3}$ and $s_i < s_{i + 5}$ for all $i \geq 0$.

We can then write down a "circular" inequality $$s_0 > s_3 > s_6 > s_1 > s_4 > s_7 > s_2 > s_5 > s_0$$ which is obviously a contradiction. This shows that $n < 7$.

For $n = 6$, we just omit the term $s_7$ from the above circle and get $$s_2 > s_5 > s_0 > s_3 > s_6 > s_1 > s_4$$ from which we may assign arbitrary values to $s_1, \dots, s_6$ that respect the inequality. The values of $a_i$ are then recovered as $s_i - s_{i - 1}$.

E.g. taking $s_2 = 2, s_5 = 1, s_3 = -1, s_6 = -2, s_1 = -3, s_4 = -4$, we get $a_1 = -3, a_2 = 5, a_3 = -3, a_4 = -3, a_5 = 5, a_6 = -3$.