A positive integer that is the same when read forwards or backwards is called a palindrome. A table is created, as shown, in which the first column contains all palindromes between 1000 and 10000 , listed in

| Palindrome | Difference |
| :---: | :---: |
| 1001 | 110 |
| 1111 | 110 |
| 1221 | 110 |
| 1331 | 110 |
| 1441 | $\vdots$ |
| $\vdots$ |  |

poritive diference between each pair of consecutive palindromes. For example, 1001 and 1111 are consecutive palindromes and their positive difference is $1111-1001=110$.

(a) What are the eighth and ninth palindromes in the first column of the table?

(b) The second column of the table contains only two different numbers: 110 and $x$. Determine the value of $x$.

(c) When the table is complete, there are $N$ palindromes in the first column. What is the value of $N$ ?

(d) Determine the average of all of the $N-1$ numbers in the second column of the table.
(a) When the table is continued, we obtain

| Palindrome | Difference |
| :---: | :---: |
| 1001 | 110 |
| 1111 | 110 |
| 1221 | 110 |
| 1331 | 110 |
| 1441 | 110 |
| 1551 | 110 |
| 1661 | 110 |
| 1771 | 110 |
| 1881 | 110 |
| 1991 | 11 |
| 2002 | 110 |
| 2112 | $\vdots$ |
| $\vdots$ |  |

The eighth and ninth palindromes in the first column are 1771 and 1881.

(b) When we continue to calculate positive differences between the palindromes in the first column, we see that

$$
1551-1441=1661-1551=1771-1661=1881-1771=1991-1881=110
$$

but that $2002-1991=11$.

Since we are told that there are only two possible differences, then $x=11$.

(c) Solution 1

The palindromes between 1000 and 10000 are exactly the positive integers of the form xyyx where $x$ and $y$ are digits with $1 \leq x \leq 9$ and $0 \leq y \leq 9$. (We note that each integer is a palindrome and that every palindrome in the desired range has four digits and so is of this form.)

Since there are 9 choices for $x$ and 10 choices for $y$, then there are $9 \times 10=90$ palindromes in the first column.

That is, $N=90$.

## Solution 2

The palindromes between 1000 and 10000 are exactly all of the four-digit palindromes. Between 1000 and 2000, there are 10 palindromes, as seen in the table above.

Between 2000 and 3000, there are also 10 palindromes:

$$
2002,2112,2222,2332,2442,2552,2662,2772,2882,2992
$$

Similarly, between 3000 and 4000, there are 10 palindromes, as there are between 4000 and 5000, between 5000 and 6000 , between 6000 and 7000, between 7000 and 8000 , between 8000 and 9000 , and between 9000 and 10000 .

In other words, in each of these 9 ranges, there are 10 palindromes, and so there are $9 \times 10=90$ palindromes in total.

That is, $N=90$.
(d) Since there are 90 palindromes in the first column, there are 89 differences in the second column.

The difference between two consecutive palindromes with the same thousands digit is 110 .

This is because two such palindromes can be written as $x y y x$ and $x z z x$, where $z=y+1$.

When these numbers are subtracted, we obtain " 0110 " or 110.

Since there are 9 groups of 10 palindromes with the same thousands digit, then there are $10-1=9$ differences equal to 110 in each of these 9 groups. This represents a total of $9 \times 9=81$ differences.

Since there are 89 differences and each is equal to 110 or to 11 (from (b)), then there are $89-81=8$ differences equal to 11 .

(We can check that the difference between the consecutive palindromes $x 99 x$ and $w 00 w$ (where $w=x+1$ ) is always 11.)

Thus, the average of the 89 numbers in the second column is

$$
\frac{81 \cdot 110+8 \cdot 11}{89}=\frac{8910+88}{89}=\frac{8998}{89}
$$