The following sequence of p = 7 terms: 5 ; -3 ; 1 ; -4 ; 6 ; -4 ; 1 has a positive sum, and each sum of q = 4 consecutive terms is negative. Does anybody know the general conditions on p and q to obtain that kind of property?
About some finite sequences of integers
2
$\begingroup$
sequences-and-series
puzzle
-
0check this [link](http://bit.ly/LFDFjI) – 2012-06-14
1 Answers
2
This can be done if and only if $q$ doesn't divide $p$.
If $q$ doesn't divide $p$, $p=qn+r$, with $r >0$. Then the sequence
$q-1, -1, -1, -1, .., -1$ wher e there are $r$ terms, followed by a series of $n$ sequences of the form
$-1, -1, ..., q-1$, with $q$ terms works.
The exact sequence is $a_1, a_2,... a_n$ where
$a_1=q-1, a_{r+qk}=q-1 \forall 1 \leq k \leq n-1$ and $a_l=-1$ otherwide.
If $q$ divides $p$, it is trivial to show that such sequence cannot exist.
if you need the sum to be strictly negative, the problem becomes more complicated...
-
0Thank you. My purpose is to get the sum strictly negative. Folowing your method, I mean, with p = nq+r, to take n blocks A of q terms, like A = {(n+2), $0$,..0,-1,-(n+2)}. So, the sum of these n blocks is (-n). The sum of the last r terms of the sequence must be (n+1).This part will be {0,0,...,0,(n+1). – 2012-06-13