An odd positive integer $n$ is called pretty if there exists at least one permutation $a_1, a_2,..., a_n$, of $1,2,...,n$, such that all $n$ sums $a_1-a_2+a_3-...+a_n$, $a_2-a_3+a_4-...+a_1$,..., $a_n-a_1+a_2-...+a_{n-1}$ are positive. Find all pretty integers.
Problem
Source: Thailand TSTST 2021, test 3, P3
Tags: combinatorics
17.08.2022 07:45
All 4k+1 number.
17.08.2022 07:47
If n=4k+1 then 2+...+n not divisible by 2 therefore exist a sum that not postive by remove 1.
21.09.2024 14:06
The answer is all $n= 4k+1$ for all positive integers $k$. First, we gonna show that such sequence always exist for $n=4k+1$ We are gonna show it with induction. The tuplets for $n=5$ is $$(a_1,a_2,a_3,a_4,a_5) = (1,2,3,5,4)$$ We get that the sum is $$a_1-a_2+a_3-a_4+a_5 = 1$$$$a_2-a_3+a_4-a_5 + a_1 = 1$$$$a_3-a_4+a_5-a_1+a_2 = 3$$$$a_4-a_5 + a_1 - a_2+a_3 = 3$$$$a_5-a_1+a_2-a_3+a_4 = 7$$which satisfy the condition. Now suppose this is true for $n=4k+1$. We wanna show that it is also true for $4k+5$ or $n+4$. Suppose the sum is $$a_1-a_2+a_3-\dots+a_n = 1$$We let $a_{n+1},a_{n+2},a_{n+3},a_{n+4}$ be $n+1, n+2, n+4,n+3$. Note that the sum $$a_1-a_2+a_3-...+a_{n+4} =1 $$So, it is sufficient to consider only $4$ sums $$a_{n+1} - a_{n+2} + a_{n+3} - \dots + a_{n} = 1$$$$a_{n+2} - a_{n+3} + a_{n+4} - \dots + a_{n+1} = 2n+1$$$$a_{n+3} - a_{n+4} + a_{1} - \dots + a_{n+2} = 3$$$$a_{n+4} - a_{1} + a_{2} - \dots + a_{n+3} = 2n+5$$Thus, there exist a sequence for all $n= 4k+1$ Now, we are gonna show that $n=4k+3$ doesn’t work. Define $$b_i = a_i-a_{i+1}+ \dots + a_{i-1}$$So, we get the recurrsive $$b_{i} + b_{i+1} = 2a_i$$Since $a_1,a_2,\dots,a_n$ is a permutation of $1,2,\dots,n$, we suppose $p$ be an integer such that $a_p =1$. Suppose $n$ is pretty integer. We have $b_i \geqslant 1$ for all positive integer $i$ Consider $$2 \leqslant b_p + b_{p+1} = 2a_p = 2$$Thus, $$b_p = b_{p+1} = 1$$Note that the parity of $$a_p - a_{p+1} + a_{p+2} - \dots +a_{p-1}, a_1 + a_2 + \dots + a_n$$is the same, so $$2 \nmid \frac{n^2 + n}{2}$$By simply, plugin $n=4k+3$, we can check that $4k+3$ isn’t pretty. Thus, the set of pretty integer is $$\{ n | n= 4k+1, \text{for all positive integers } k \}$$