MathDB
You'll hate this one...

Source: German TST 2004, exam III

May 18, 2004
analytic geometrycombinatorics proposedcombinatorics

Problem Statement

Let n2n \geq 2 be a natural number, and let (a1;  a2;  ...;  an)\left( a_{1};\;a_{2};\;...;\;a_{n}\right) be a permutation of (1;  2;  ...;  n)\left(1;\;2;\;...;\;n\right). For any integer kk with 1kn1 \leq k \leq n, we place aka_k raisins on the position kk of the real number axis. [The real number axis is the xx-axis of a Cartesian coordinate system.] Now, we place three children A, B, C on the positions xAx_A, xBx_B, xCx_C, each of the numbers xAx_A, xBx_B, xCx_C being an element of {1;  2;  ...;  n}\left\{1;\;2;\;...;\;n\right\}. [It is not forbidden to place different children on the same place!] For any kk, the aka_k raisins placed on the position kk are equally handed out to those children whose positions are next to kk. [So, if there is only one child lying next to kk, then he gets the raisin. If there are two children lying next to kk (either both on the same position or symmetric with respect to kk), then each of them gets one half of the raisin. Etc..] After all raisins are distributed, a child is unhappy if he could have received more raisins than he actually has received if he had moved to another place (while the other children would rest on their places). For which nn does there exist a configuration (a1;  a2;  ...;  an)\left( a_{1};\;a_{2};\;...;\;a_{n}\right) and numbers xAx_A, xBx_B, xCx_C, such that all three children are happy?