# Suggested solutions 1. We first prove the lemma that if $x_{1}>\cdots>x_{2 n}$ then the grouping $$ \left\{\left\{x_{1}, x_{2}\right\}, \ldots,\left\{x_{2 n-1}, x_{2 n}\right\}\right\} $$ gives the largest sum of products of pairs of these numbers. Let $a$ be the largest and $b$ the second largest among the numbers $x_{i}$. Consider a grouping of these numbers into pairs such that $a$ is paired with some $c$, and $b$ is paired with some $d$, where $c \neq b$. Then $a \neq d$ (otherwise $a$ would be together with $b$ ). Furthermore, $b>c$ since otherwise the choice of $b$ implies $a=c$ or $b=c$ which are both excluded. Now $$ \begin{aligned} a b+c d & =a c+a(b-c)+b d-(b-c) d \\ & =a c+b d+(a-d)(b-c)>a c+b d \end{aligned} $$ that is, replacing the pairs $\{a, c\}$ and $\{b, d\}$ by the pairs $\{a, b\}$ and $\{c, d\}$ makes the sum larger. If the two largest numbers are paired already, we can do the same to the remaining numbers. So whenever the grouping is different from (1), the sum of the products of pairs can be made larger. Now it suffices to prove that $a_{n}=\frac{1}{1} \cdot \frac{1}{2}+\cdots+\frac{1}{2 n-1} \cdot \frac{1}{2 n}<1$. We have $$ \begin{aligned} a_{n} & =\frac{1}{1 \cdot 2}+\frac{1}{3 \cdot 4}+\cdots+\frac{1}{(2 n-1) \cdot(2 n)} \\ & =\frac{2-1}{1 \cdot 2}+\frac{4-3}{3 \cdot 4}+\cdots+\frac{2 n-(2 n-1)}{(2 n-1) \cdot(2 n)} \\ & =\left(\frac{1}{1}-\frac{1}{2}\right)+\left(\frac{1}{3}-\frac{1}{4}\right)+\cdots+\left(\frac{1}{2 n-1}-\frac{1}{2 n}\right) \\ & \leq\left(\frac{1}{1}-\frac{1}{2}\right)+\left(\frac{1}{2}-\frac{1}{3}\right)+\left(\frac{1}{3}-\frac{1}{4}\right)+\cdots+\left(\frac{1}{2 n-1}+\frac{1}{2 n}\right) \\ & =1-\frac{1}{2 n} \\ & <1 . \end{aligned} $$ 2. Assume that such an exact sequence exists. Then by induction we must have $a_{2 k}^{2}=a_{2 k-2}^{2}+a_{4 k-2} a_{2}=$ $a_{2 k-2}^{2}=0$. Next we prove by induction that $a_{2 n+1}=(-1)^{n}$. We have $a_{3}=a_{2}^{2}-a_{1}^{2}=-1$ and $$ \begin{aligned} & a_{4 k+1}=a_{2 k+1}^{2}-a_{2 k}^{2}=1, \\ & a_{4 k+3}=a_{2 k+2}^{2}-a_{2 k+1}^{2}=-1, \end{aligned} $$ when $k \geq 1$. This shows that if such a sequence exists, necessarily $a_{2007}=-1$. It remains to show that the sequence defined by $a_{n}=0$ for $n$ even, $a_{n}=1$ when $n \equiv 1(\bmod 4)$ and $a_{n}=-1$ when $n \equiv 3(\bmod 4)$ is exact: If $n$ and $m$ have the same parity, then $n-m$ and $n+m$ are both even, and then clearly $a_{n}^{2}-a_{m}^{2}=0=$ $a_{n-m} a_{n+m}$. If $n$ is odd and $m$ is even, $n-m \equiv n+m(\bmod 4)$, so $a_{n}^{2}-a_{m}^{2}=1=a_{n-m} a_{n+m}$, since both factors are either -1 or +1 . Finally, if $n$ is even and $m$ is odd, $n-m \not \equiv n+m(\bmod 4)$, so $a_{n}^{2}-a_{m}^{2}=-1=a_{n-m} a_{n+m}$, since exactly one factor is -1 and one factor is +1 . 3. Consider the polynomial $P(x)=G(x)-F(x)$. It has degree at most $2 n+1$. By the condition (1) we have $P(x) \geq 0$ for all real $x$. By the condition (2) the numbers $x_{1}, x_{2}, \ldots, x_{n}$ are roots of $P$. Since $P$ is non-negative, each of these roots must have even multiplicity, and therefore $P$ must be divisible by $\left(x-x_{i}\right)^{2}$ for $i=1,2, \ldots, n$. In other words, $$ P(x)=Q(x)\left(x-x_{1}\right)^{2}\left(x-x_{2}\right)^{2} \cdots\left(x-x_{n}\right)^{2} $$ for some polynomial $Q$. Calculating degrees we see that $\operatorname{deg} Q=\operatorname{deg} P-2 n \leq 1$. On the other hand, we have $Q(x) \geq 0$ for all real $x$. This can be possible only if $Q$ is constant. Hence $$ G(x)-F(x)=a\left(x-x_{1}\right)^{2}\left(x-x_{2}\right)^{2} \cdots\left(x-x_{n}\right)^{2} $$ for some real constant $a \geq 0$. Similarly we prove that $$ H(x)-F(x)=b\left(x-x_{1}\right)^{2}\left(x-x_{2}\right)^{2} \cdots\left(x-x_{n}\right)^{2} $$ for some $b \geq 0$. Now we compute that $$ F(x)+H(x)-2 G(x)=(b-2 a)\left(x-x_{1}\right)^{2}\left(x-x_{2}\right)^{2} \cdots\left(x-x_{n}\right)^{2} . $$ By the assumption (3) the above number is equal to 0 for some value of $x=x_{0}$ different from $x_{1}, x_{2}, \ldots$, $x_{n}$. Looking at the right-hand side we see that this forces $b-2 a=0$, so the expression becomes identically zero. In other words, we have $F(x)+H(x)-2 G(x)=0$ for all real $x$, which is what we wanted. 4. Rewrite the two factors on the left-hand side: $$ \begin{aligned} 2 S+n & =\left(a_{1}+a_{2}+\cdots+a_{n}\right)+\left(a_{2}+a_{3}+\cdots a_{1}\right)+1+\cdots+1 \\ 2 S+a_{1} a_{2}+a_{2} a_{3}+\cdots+a_{n} a_{1} & =\left(a_{2}+a_{3}+\cdots+a_{1}\right)+\left(a_{1}+a_{2}+\cdots a_{n}\right)+a_{1} a_{2}+a_{2} a_{3}+\cdots+a_{n} a_{1} \end{aligned} $$ Applying the Cauchy-Schwarz inequality to the $3 n$-vectors $$ \left(\sqrt{a_{1}}, \ldots, \sqrt{a_{n}}, \sqrt{a_{2}}, \ldots, \sqrt{a_{1}}, 1, \ldots, 1\right) \quad \text { and } \quad\left(\sqrt{a_{2}}, \ldots, \sqrt{a_{1}}, \sqrt{a_{1}}, \ldots \sqrt{a_{n}}, \sqrt{a_{1} a_{2}}, \ldots, \sqrt{a_{n} a_{1}}\right) $$ we obtain $$ (2 S+n)\left(2 S+a_{1} a_{2}+a_{2} a_{3}+\cdots a_{n} a_{1}\right) \geq\left(3 \sum_{i=1}^{n} \sqrt{a_{i} a_{i+1}}\right)^{2} $$ with $a_{n+1}=a_{1}$. 5. Set $y=1$ in the first equation. This gives $f(x)=f(x) f(-1)-f(x)+f(1)$, that is, $f(x)(2-f(-1))=f(1)$. Since $f$ is not constant, we must have $f(-1)=2$ and $f(1)=0$. Substituting $-x$ instead of $x$ and $y=-1$ in the first equation gives $f(x)=f(-x) f(1)-f(-x)+f(-1)=-f(-x)+2$. If we let $g(x)=1-f(x)$, this means that $g$ is an odd function. Rewriting the first equation in terms of $g$ gives $$ \begin{aligned} g(x y) & =1-f(x y)=1-((1-g(x))(1-g(-y))-(1-g(x))+(1-g(y))) \\ & =-g(x) g(-y)+g(-y)+g(y)=g(x) g(y) \end{aligned} $$ Now the second equation gives (since $g(1)=-g(-1)=1$ ) $$ 1-g(1-g(x))=\frac{1}{1-g(1 / x)}=\frac{1}{1-1 / g(x)}=\frac{g(x)}{g(x)-1} $$ that is, $$ g(1-g(x))=\frac{1}{1-g(x)} $$ Since $f$ takes all values except $1, g$ takes all values except 0 . By setting $y=1-g(x)$ it follows that $g(y)=1 / y$ for all $y \neq 0$, that is, $f(x)=1-g(x)=1-1 / x$. It is easily verified that this function satisfies the conditions of the problem. 6. First note that, whenever the numbers are not ordered ascendingly, there exists a pair $(i, j)$ (not necessarily in the list) such that $1 \leq i\ell$ then $a b(a-b)$ is divisible by at least $p^{k+2 \ell}$. The three summands in the first number is divisible by $p^{3 k}, p^{3 \ell}$ and $p^{k+\ell}$. Since $3 \ell$ and $k+\ell$ are less than $k+2 \ell$, the divisibility of the given numbers is possible if and only if $k+\ell=3 \ell$ (in this case the sum $b^{3}+a b$ could be divisible by a power of $p$ greater than $\left.p^{k+\ell}\right)$. Therefore, we have $k=2 \ell$, and hence the maximal power of $p$ that divides $a b$ is $p^{3 \ell}$.