B3. A palindromic number is a positive integer (of one or more digits) that remains the same when the order of the digits is reversed. For example, 1245421 and 333 are palindromic numbers, but 345 and 100 are not. There is exactly one palindromic number \( n \) such that when you subtract 2018 from it, the result is also a palindromic number.

What is this number \( n \)?
3. 2442 Assume that $n$ is a palindrome number and that $n-2018$ is also a palindrome number. The first and last digit of $n$ we call $a$. Note that the last digit of $n-2018$ is equal to $a-8$ if $a \geqslant 8$ and is equal to $a-8+10=a+2$ if $a<8$.

First, consider the case where $n$ has five or more digits. If $a \geqslant 2$, then the first digit of $n-2018$ is equal to $a$ or $a-1$. The last digit, however, is equal to $a-8$ or $a+2$, so $n-2018$ is not a palindrome number. Now consider the case where $a=1$. If $n$ has exactly five digits, then $n-2018$ lies between $10000-2018=7982$ and $19999-2018=17981$. The first digit of $n-2018$ is then 7, 8, 9, or 1. If $n$ has six or more digits, then the first digit of $n-2018$ is equal to 1 or 9 (for example, if $100000 \leqslant n \leqslant 102017$). In both cases, the last digit of $n-2018$ is, however, $a+2=3$, so $n-2018$ is not a palindrome number.

Now, the remaining case is that $n$ has four digits. Since $n$ must be greater than 2018, it follows that $a \geqslant 2$. If $a \geqslant 4$, then the first digit of $n-2018$ is equal to $a-2$ or $a-3$. The last digit, however, is equal to $a-8$ or $a+2$, so $n-2018$ is not a palindrome number. If $a=3$, then the first digit of $n-2018$ is 1 or 9. The last digit, however, is 5, so $n-2018$ is not a palindrome number.

The only remaining case is $n=2bb2$ with $b \geqslant 1$. We see that $2112-2018=94$ is not a palindrome number. In the case where $b \geqslant 2$, the last digit of $n-2018$ is 4 and the first digit is $b$. The only possibility is therefore $n=2442$. The difference $2442-2018=424$ is indeed a palindrome number.