Find all odd integers n > 1 for which there is at least one permutation a1, a2, ... , an of 1, 2, 3, ... , n such that the sums
a1 - a2 + a3 - ... + an,
a2 - a3 + a4 - ... - an + a1,
a3 - a4 + ... + an - a1 + a2,
...
an - a1 + a2 - ... + an-1
are all positive.
Answer
n = 1 mod 4.
Solution
As usual take cyclic indices, so that an index of n+1 means 1, an index of n+2 means 2 etc. Put bi = ai - ai+1 + ai+2 - ai+3 + ... + ai-1. Then bi + bi+1 = 2ai.
Suppose n = 4k+1. Then take the permutation 2, 4, 6, 8, ... , 4k, 4k+1, 4k-1, 4k-3, ... , 5, 3, 1. It is easy to check that the sums are 1, 3, 5, 7, ... , 4k+1, 4k+1, 4k-3, 4k-3, 4k-7, 4k-7, ... , 5, 5, 1. (Check the first one: (2 - 4) + (6 - 8) + (10 -12) + ... + (4k-2 - 4k) + (4k+1 - (4k-1)) + ... + (5 - 3) + 1 = 1. Then use the relation above.) So there is a permutation for n = 4k+1
Now suppose we have a permutation which works for n = 4k - 1.Then 1 + 2 + 3 + ... + n = 2k(4k - 1) is even. Hence each yi is even. So if all yi are positive, then all yi are at least 2. But for some i we must have yi + yi+1 = 1. Contradiction. So it is not possible for n = -1 mod 4.
[Note that the permutation is not unique, because if ai works, then so does a cyclic permutation of ai. But even if we require a1 = 1, the permutation is not unique. For example, for n = 5, we have 1, 2, 3, 5, 4 giving 1, 1, 3, 3, 7, and 1, 2, 4, 5, 3 giving 1, 1, 3, 5, 5.]
© John Scholes
jscholes@kalva.demon.co.uk
2 Jan 2003
Last corrected/updated 2Jan 03