# A sequence of real numbers

A sequence of real numbers is such that the the sum of every $5$ consecutive terms is $+ve$ while the sum of every $9$ consecutive terms is $-ve$. Then the sequence can have at most $n$ terms.

What is the value of $n$ $?$

• Every 5 consecutive terms and every 9 consecutive terms of the infinite sequence {0,0,0,...} sum to 0. – David Hammen Jan 11 '18 at 0:51

12

Explanation:

General formula for this IMO 1977 problem has been derived here on Math.SE

$p\to$Number of consecutive terms giving +ve sum
$q\to$Number of consecutive terms giving -ve sum
$$n=p+q-2$$

Further to prog_SAHIL's answer, one example is

4, 3, 4, -16, 6, 4, 4, 6, -16, 4, 3, 4

where the respective sums of 5 consecutive terms are

1, 1, 2, 4, 4, 2, 1, 1

and the respective sums of 9 consecutive terms are

-1, -1, -1, -1