Write the digits from 0 to 9 in a line, in the order you choose. On the line below, join the neighbors, forming nine new numbers, and add these numbers as in the example:

| 2 |  | 1 |  | 3 |  | 7 |  | 4 |  | 9 |  | 5 |  | 8 |  | 0 |  | 6 |
| :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- |
|  | 21 |  | 13 |  | 37 |  | 74 |  | 49 |  | 95 |  | 58 |  | 80 |  | 06 |  |
| 1 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |

What is the largest sum that can be obtained in this way?
A) 506
B) 494
C) 469
D) 447
E) 432
Solution

## ALTERNATIVE B

For any arrangement of the digits, the sum of the "joined" neighbors will always have nine terms, without repetition of digits in the units or in the tens. The only digit that does not appear in the units is the first, and the only one that does not appear in the tens is the last. For the sum to be maximum, the digit 0 should not appear in the tens and, therefore, must be the last; furthermore, the smallest of the digits $1,2, \ldots, 9$ should not appear in the units and, therefore, the 1 must be the first. We conclude that the sum is maximum for any choice where 1 is the first digit and 0 is the last. In this case, the sum of the units will be $0+2+3+4+5+6+7+8+9=44$ and the sum of the tens will be $10+20+30+40+50+60+70+80+90=450$; the maximum sum is then $450+44=494$.

Algebraically, we can write this argument as follows. Let $a_{1}, a_{2}, \ldots, a_{10}$ be any arrangement of the digits from 0 to 9 in the first line. In the second line of the table in the statement of this question, the numbers $a_{1} a_{2}, a_{2} a_{3}, \ldots, a_{9} a_{10}$ will appear. Using the decimal representation, the sum of these numbers can be written in the form

$$
\begin{aligned}
S & =a_{1} a_{2}+a_{2} a_{3}+\cdots+a_{9} a_{10} \\
& =\left(10 a_{1}+a_{2}\right)+\left(10 a_{2}+a_{3}\right)+\cdots+\left(10 a_{9}+a_{10}\right) \\
& =10 \times\left(a_{1}+a_{2}+\cdots+a_{9}\right)+\left(a_{2}+\cdots a_{9}+a_{10}\right)-10 a_{10}-a_{1} \\
& =11 \times\left(a_{1}+a_{2}+\cdots+a_{9}+a_{10}\right)-10 a_{10}-a_{1} \\
& =45 \times 11-10 a_{10}-a_{1} \\
& =495-10 a_{10}-a_{1}
\end{aligned}
$$

Therefore, the maximum value of $S$ is achieved when $a_{10}=0$ and $a_{1}=1$, and in this case, it is $495-10 \times 0-1=494$.