# 2001 Pan African MO Problems/Problem 4

## Problem

Let $n$ be a positive integer, and let $a>0$ be a real number. Consider the equation: $$\sum_{i=1}^{n}(x_i^2+(a-x_i)^2)= na^2$$ How many solutions ( $x_1, x_2 \cdots , x_n$) does this equation have, such that: $$0 \leq x_i \leq a, i \in N^+$$

## Solution

First, rearrange the equation by expanding, simplifying, and using properties of summation. \begin{align*} \sum_{i=1}^{n} (x_i^2 + a^2 - 2ax_i + x_i^2) &= na^2 \\ \sum_{i=1}^{n} (a^2 + 2x_i^2 - 2ax_i) &= na^2 \\ na^2 + 2 \sum_{i=1}^{n} (x_i^2) - 2a \sum_{i=1}^{n} (x_i) &= na^2 \\ 2 \sum_{i=1}^{n} (x_i^2) - 2a \sum_{i=1}^{n} (x_i) &= 0 \\ \sum_{i=1}^{n} (x_i^2) - a \sum_{i=1}^{n} (x_i) &= 0 \end{align*} Next, we can try smaller values of $i$ to find patterns. If $i = 1$, then the equation becomes $x_1^2 - ax_1 = 0$, so $x_1 = 0$ or $x_1 = a$. If $i = 2$, we can graph the equation on the Cartesian plane (with axes as $x_1$ and $x_2$). The equation is a circle, and from the bounds, the only solutions are $(0,0),(0,a),(a,0),(a,a)$. It seems as if the solution to the set involves only $0$ and $a$. To prove this, we need to prove that solutions involving only $0$ and $a$ would work and that no other solutions are possible.

For the first part, we can use induction. The base case is already covered since the solutions for $i = 1$ are $x_1 = 0$ or $x_1 = a$. For the inductive step, assume that $\sum_{i=1}^{n}(x_i^2+(a-x_i)^2)= na^2$, where $x_i = 0$ or $x_i = a$ for integer values of $i$. If $x_{i+1} = 0$, then $x_{i+1}^2+(a-x_{i+1})^2 = a^2$, and if $x_{i+1} = a$, then $x_{i+1}^2+(a-x_{i+1})^2 = a^2$. Thus, $\sum_{i=1}^{n}(x_i^2+(a-x_i)^2) + x_{i+1}^2+(a-x_{i+1})^2 = (n+1)a^2$. The inductive step holds, so solutions are all ordered pairs $(x_1, x_2, \cdots x_n)$ where $x_i = 0$ or $x_i = a$ for integer values of $i$.

For the second part, note that we can complete the square for $x_i$ to get $(x_1 - \tfrac{a}{2})^2 + (x_2 - \tfrac{a}{2})^2 + \cdots (x_n - \tfrac{a}{2})^2 = \tfrac{na^2}{4}$. We know that for integer values of $i$, $0 \le x_i \le a$, so $-\tfrac{a}{2} \le x_i - \tfrac{a}{2} \le \tfrac{a}{2}$. Thus, $(x_i - \tfrac{a}{2})^2 \le \tfrac{a^2}{4}$.

If $x_i = a$ or $x_i = 0$, then $(x_i - \tfrac{a}{2})^2 \le \tfrac{a^2}{4}$. If $x_i \ne 0, a$, then $0 < x_i < a$, so $(x_i - \tfrac{a}{2})^2 < \tfrac{a^2}{4}$. WLOG, let $0 < x_1 < a$, making $(x_1 - \tfrac{a}{2})^2 < \tfrac{a^2}{4}$. Thus, $\sum_{i=1}^n (x_i - \tfrac{a}{2})^2 < \tfrac{na^2}{4}$, so there are no solutions where $x_i \ne 0, a$.

Thus, for each $x_i$ in the solution to the original equation, where $i$ is an integer, $x_i$ can only equal $0$ or $a$. Therefore, there are $\boxed{2^n}$ ordered pairs that are solutions to the equation.