6

Question : Let $p,q \in\mathbb N$ which satisfy $p\lt q$. In a finite sequence of real numbers, let us consider a sequence such that the sum of any $p$ successive terms is negative, and the sum of any $q$ successive terms is positive. Then, can we find the necessary and sufficient condition for $(p,q)$ such that there exists such a sequence whose number of terms is $p+q-2$ ?

Remark : The question above comes from the question $2$ of IMO $1977$.

Motivation : I've been able to prove that the number of terms in such a sequence is equal to or less than $p+q-2$. However, I don't know if for any $(p,q)$ there exists such a sequence whose number of terms is $p+q-2$. Can anyone help?

mathlove
  • 139,939

1 Answers1

2

In fact the maximum number of terms of such a sequence is $p+q-(p,q)-1$, where $(p,q)$ is the greatest common divisor of $p$ and $q$, so there is a sequence of length $p+q-2$ iff $p$ and $q$ are relatively prime. This result can be found on page $423$ of Dušan Djukić, Vladimir Janković, Ivan Matić, and Nikola Petrović, The IMO Compendium [PDF]; I’ve somewhat expanded the argument given there (which has some typos in the final paragraph).

Proof: Suppose that $\langle a_1,a_2,\ldots,a_\ell\rangle$ is such a sequence. For $k=0,\ldots,\ell$ let $s_k$ be the $k$-th partial sum: $s_0=0$, and $s_k=\sum_{k=1}^ka_k$ for $k=1,\ldots,\ell$. The requirement that the sum of every $p$ consecutive terms is negative means that $s_{k+p}<s_k$ for $0\le k\le\ell-p$. Similarly, the requirement that the sum of every $q$ consecutive terms is positive means that $s_k<s_{k+q}$ for $0\le k\le\ell-q$. Let $d=(p,q)$, $p_0=p/d$, and $q_0=q/d$; we show first that $\ell<p+q-d$.

Suppose, on the contrary, that $\ell\ge p+q-d$, and consider the $p_0+q_0$ partial sums $s_{kd}$ for $k=0,1,\ldots,p_0+q_0-1$. Now

$$(p_0+q_0-1)d=p+q-d=(q_0-1)d+p\,,$$

so these partial sums satisfy the $q_0$ inequalities $\color{red}{s_{kd+p}<s_{kd}}$ for $k=0,\ldots,q_0-1$. Similarly,

$$(p_0+q_0-1)d=(p_0-1)d+q\,,$$

so the partial sums also satisfy the $p_0$ inequalities $\color{blue}{s_{kd}<s_{kd+q}}$ for $k=0,\ldots,p_0-1$.

Let $s_{kd}$ be one of these partial sums. If $k<p_0$, then $s_{kd}$ appears on the left in the blue inequality $\color{blue}{s_{kd}<s_{kd+q}}$. If $p_0\le k<p_0+q_0$, let $j=k-p_0$; then $s_{kd}=\color{red}{s_{jd+p}<s_{jd}}$, where $0\le j<q_0$, so $s_{kd}$ appears on the left in one of the red inequalities. Thus, each of the $p_0+q_0$ partial sums appears on the lefthand side of exactly one of the $p_0+q_0$ inequalities. A similar argument shows that each of the partial sums also appears on the righthand side of exactly one of the inequalities. Thus, these inequalities must include a closed chain $s_{k_1}<s_{k_2}<\ldots<s_{k_n}<s_{k_1}$ for some $n\le p_0+q_0$, which is of course impossible.

Example: Take $p=6$ and $q=9$; then $d=3$, $p_0=2$, and $q_0=3$. The partial sums $s_{kd}$ for $k=0,\ldots 2+3-1$ are $s_0=0,s_3,s_6,s_9$, and $s_{12}$; the red inequalities are $s_6<0$, $s_9<s_3$, and $s_{12}<s_6$; and the blue inequalities are $0<s_9$ and $s_3<s_{12}$. Starting arbitrarily with the inequality $s_6<0$, we chain it to $0<s_9$ and continue to produce the impossible loop $$s_6<0<s_9<s_3<s_{12}<s_6\,.$$

Now let $\ell=p+q-d-1$. We still have the $q-d$ inequalities $s_{k+p}<s_k$ for $k=0,\ldots,\ell-p$ and the $p-d$ inequalities $s_k<s_{k+q}$ for $k=0\ldots,\ell-q$. Suppose that $r$ of these inequalities of the form $s_{k+p}<s_k$ and $t$ of them of the form $s_k<s_{k+q}$ can be chained to form an impossible loop $s_{k_1}<s_{k_2}<\ldots<s_{k_n}<s_{k_1}$, where of course $n=r+t$. Clearly $rp=tq$: the total decrease in subscripts along the chain must equal the total increase, since the first and last subscripts are identical. But then $rp_0=tq_0$, and $(p_0,q_0)=1$, so $p_0\mid t$ and $q_0\mid r$, and therefore $n=r+t\ge p_0+q_0$.

On the other hand, $d\mid k_i-k_{i+1}$ for $i=1,\ldots,n-1$, so $k_1\equiv k_2\equiv\ldots\equiv k_n\pmod d$. Let $j=\max\{k_1,\ldots,k_n\}$; the $n$ subscripts $k_1,\ldots,k_n$ are distinct and non-negative, so $j\ge(n-1)d$. But then $(n-1)d\le j\le\ell<p+q-d=(p_0+q_0-1)d$, so $n<p_0+q_0$. This contradiction shows that no subset of the inequalities $s_{k+p}<s_k$ for $k=0,\ldots\ell-p$ and the inequalities $s_k<s_{k+q}$ for $k=0,\ldots,\ell-q$ can be chained in an impossible loop. It only remains to see that this guarantees the existence of a sequence $\langle a_1,\ldots,a_{p+q-d-1}\rangle$ with the desired properties.

We have $p+q-2d$ inequalities that must be accommodated and no other restrictions. Partition them into maximal chains and concatenate these (in any order) into a single chain of all $\ell+1$ partial sums. Assign $s_0$ the value $0$ and assign the remaining $\ell$ partial sums values consistent with the order of the chain. Finally, use the fact that $a_k=s_k-s_{k-1}$ for $k=1,\ldots,\ell$ to compute the terms $a_k$. Any sequence determined in this fashion satisfies the requisite inequalities and therefore has the desired properties.

Example: With $p=6$ and $q=9$ we have $\ell=11$, the six inequalities $s_6<s_0$, $s_7<s_1$, $s_8<s_2$, $s_9<s_3$, $s_{10}<s_4$, and $s_{11}<s_5$, and the three inequalities $s_0<s_9$, $s_1<s_{10}$, and $s_2<s_{11}$. We can partition them into the maximal chains

$$\begin{align*} &s_6<s_0<s_9<s_3\,,\\ &s_7<s_1<s_{10}<s_4\,,\text{ and}\\ &s_8<s_2<s_{11}<s_5\,. \end{align*}$$

Concatenate these into a single chain and assign values:

$$s_6<s_0<s_9<s_3<s_7<s_1<s_{10}<s_4<s_8<s_2<s_{11}<s_5\,.$$

$$\begin{array}{ccc} s_6&s_0&s_9&s_3&s_7&s_1&s_{10}&s_4&s_8&s_2&s_{11}&s_5\\ -1&0&1&2&3&4&5&6&7&8&9&10 \end{array}$$

Then $a_1=s_1-s_0=4$, $a_2=s_2-s_1=4$, and so on, and we find that the corresponding sequence $\langle a_1,\ldots,a_{11}\rangle$ is $\langle 4,4,-6,4,4,-11,4,4,-6,4,4\rangle$.

Note that if $p$ and $q$ are relatively prime, we have $p+q-2=\ell$ inequalities to accommodate, and in that case we get a single maximal chain.

Example: If $p=4$ and $q=7$, so that $\ell=9$, the six inequalities of the form $s_{k+4}<s_k$ and the three of the form $s_k<s_{k+7}$ form the single chain

$$s_6<s_2<s_9<s_5<s_1<s_8<s_4<s_0<s_7<s_3\,.$$

Brian M. Scott
  • 616,228
  • I was scratching my head at how you could reference this problem in a MathSE response. Then it hit me. You didn't originate this MathSE response, someone else did. However, you are from the future. So, in an attempt to get the $+10$ reputation points, you came into the past of today, in this alternative timeline, to post the answer that someone else MathSE posted in your original timeline. – user2661923 Apr 10 '22 at 01:05
  • @user2661923: If only I were that talented! :-) – Brian M. Scott Apr 10 '22 at 01:08