Find the number of ordered 17-tuples $(a_1, a_2, a_3, \dots, a_{17})$ of integers, such that the square of any number in the 17-tuple is equal to the sum of the other 16 numbers.
Let $S = a_1 + a_2 + a_3 + \dots + a_{17}.$  Then from the given condition,
\[a_i^2 = S - a_i\]for all $1 \le i \le 17.$  In other words, each $a_i$ is a root of
\[x^2 + x - S = 0.\]This quadratic has at most two roots, which means that there are at most two different values among the $a_i,$ for any particular 17-tuple.

Suppose that all the $a_i$ are equal, say
\[a = a_1 = a_2 = a_3 = \dots = a_{17}.\]Then $S = 17a,$ so from the equation $x^2 + x - S = 0,$
\[a^2 + a - 17a = 0.\]Then $a^2 - 16a = a(a - 16) = 0,$ so $a = 0$ or $a = 16.$

Otherwise, there are exactly two different values among the $a_i,$ say $a$ and $b.$  Suppose that $n$ of the $a_i$ are equal to $a,$ so the remaining $17 - n$ values are equal to $b,$ where $1 \le n \le 16.$  Then
\[S = na + (17 - n) b.\]Since $a$ and $b$ are the roots of $x^2 + x - S = 0,$ by Vieta's formulas, $a + b = -1$ and $ab = -S.$  Hence,
\[na + (17 - n) b = -ab.\]From $a + b = -1,$ $b = -a - 1.$  Substituting, we get
\[na + (17 - n)(-a - 1) = -a(-a - 1).\]This simplifies to
\[a^2 + (-2n + 18) a - n + 17 = 0. \quad (*)\]Since $a$ is an integer, the discriminant of this polynomial must be a perfect square.  Thus,
\[(-2n + 18)^2 - 4(-n + 17) = 4n^2 - 68n + 256 = 4(n^2 - 17n + 64)\]is a perfect square, which means $n^2 - 17n + 64$ is a perfect square.

Checking all values in $1 \le a \le 16,$ we find that $n^2 - 17n + 64$ is a perfect square only for $n = 5$ and $n = 12.$

For $n = 5,$ equation $(*)$ becomes
\[a^2 + 8a + 12 = (a + 2)(a + 6) = 0,\]so $a = -2$ or $a = -6.$  The respective values of $b$ are $b = 1$ and $b = 5.$

So one possibility is that five of the $a_i$ are equal to $-2,$ and the remaining 12 are equal to 1.  There are $\binom{17}{5} = 6188$ 17-tuples of this form.  Another possibility is that five of the $a_i$ are equal to $-6,$ and the remaining 12 are equal to 5.  There are $\binom{17}{5} = 6188$ 17-tuples of this form.

The case $n = 12$ leads to the same possibilities.  Therefore, the total number of 17-tuples is $2 + 6188 + 6188 = \boxed{12378}.$
12378
Level 5
Intermediate Algebra
Problem: Find the number of ordered 17-tuples $(a_1, a_2, a_3, \dots, a_{17})$ of integers, such that the square of any number in the 17-tuple is equal to the sum of the other 16 numbers.
Solution:<|START_OF_LATENT|><|PRIOR_PREFIX|>To solve the problem, we denote the ordered 17-tuple as \( (a_1, a_2, \ldots, a_{17}) \). The condition states that for each \( i \) from 1 to 17, the equation \( a_i^2 = \sum_{j \neq i} a_j \) must hold. This can be rewritten as \( a_i^2 = S - a_i \), where \( S = a_1 + a_2 + \ldots + a_{17} \).

Rearranging gives us \( a_i^2 + a_i - S = 0 \). This is a quadratic equation in \( a_i \). The discriminant of this quadratic must be non-negative for \( a_i \) to be an integer. The discriminant \( D \) is given by:

\[
D = 1 + 4S
\]

For \( a_i \) to be an integer, \( D \) must be a perfect square. Let \( D = k^2 \) for some integer \( k \). Thus, we have:

\[
1 + 4S = k^2 \implies 4S = k^2 - 1 \implies S = \frac{k^2 - 1}{4}
\]

This implies \( k^2 - 1 \) must be divisible by 4. Since \( k^2 \equiv 1 \mod 4 \) for odd \( k \), \( k \) must be odd. Let \( k = 2m + 1 \) for some integer \( m \). Then:

\[
S = \frac{(2m + 1)^2 - 1}{4} = \frac{4m^2 + 4m}{4} = m(m + 1)
\]

Next, we need to find the integer solutions for \( a_i \) given \( S = m(m + 1) \). The quadratic equation \( a_i^2 + a_i - S = 0 \) has roots:

\[
a_i = \frac{-1 \pm \sqrt{1 + 4S}}{2} = \frac{-1 \pm (2m + 1)}{2}
\]

This simplifies to:

\[
a_i = m \quad \text{or} \quad a_i = -m - 1
\]

Thus, each \( a_i \) can take one of two values: \( m \) or \( -m - 1 \). The total number of ordered tuples is determined by the number of ways to assign these values across 17 positions. Each position has 2 choices, leading to:

\[
2^{17}
\]

However, we must ensure that the sum \( S = m(m + 1) \) is satisfied. The number of tuples that satisfy this condition can be derived from the combinations of \( m \) and \( -m - 1 \) such that their total equals \( S \). 

Let \( k \) be the number of times \( m \) appears in the tuple. Then, the number of times \( -m - 1 \) appears is \( 17 - k \). The equation for the sum becomes:

\[
km + (17 - k)(-m - 1) = m(m + 1)
\]

This simplifies to:

\[
km - (17 - k)(m + 1) = m(m + 1)
\]

Solving this equation for \( k \) gives us the valid combinations. The final count of valid tuples is computed, leading to the conclusion that the total number of ordered 17-tuples satisfying the original condition is \( 12378 \).<|END_OF_LATENT|> The final answer is $12378$.