# Problem 8. (5 points)

For each pair of numbers $\overline{a b b}$ and $\overline{a b b}$, where $a$ and $b$ are different digits, the GCD of these numbers was calculated. Find the greatest of these GCDs.

$\overline{a b b}$ is the standard notation for a number consisting of the digits $a, b$, and $b$ in that exact order.

Answer: 45
Solution:

45 is the greatest common divisor (GCD) of the numbers 585 and 855.

Note that \(a\) and \(b\) are not equal to 0, as numbers cannot start with 0.

Suppose there are two numbers for which this GCD is greater than 45. Note that \(\overline{b a b} - \overline{a b b} = 90(b - a)\) is divisible by this GCD. Divisibility by 2 and 5 is determined by the last digit, which is \(b\), and it cannot be zero, so the GCD cannot be both even and divisible by 5.
\(|a - b| \leqslant 8\), so if the GCD is not divisible by 3, it cannot be greater than \(2|a - b| \leqslant 16\) or \(5|a - b| \leqslant 40\) depending on the case we are considering.

Therefore, for the GCD to be greater than 45, it must be divisible by 3, and thus the original numbers must be divisible by 3.

For the number \(\overline{b a b}\) to be divisible by 3, the numbers \(a\) and \(b\) must give the same remainder when divided by 3. Thus, \(|a - b|\) can take the values 3 or 6, and consequently, the GCD must be a divisor of the number \(540 = 3^3 \cdot 2^2 \cdot 5\), and it still cannot contain both 2 and 5 simultaneously. If we are interested in a GCD greater than 45, it must be divisible by 9, and more specifically, by 27. This means the number \(\overline{b a b}\) must be divisible by 9. When this condition is met, the digit \(a\) almost uniquely determines the digit \(b\) according to the divisibility rule for 9.

Thus, for \(\overline{b a b}\), it makes sense to consider only the numbers 171, 252, 333, 414, 585, 666, 747, 828, 909, and 999 (some of which do not fit because \(a \neq b\), for example, 999). The remaining numbers form two arithmetic progressions with a common difference of 81 each. Since 81 is divisible by 27, it is sufficient to check that 171 and 585 are not divisible by 27, and the other numbers will also not be divisible.

Therefore, the GCD is not divisible by 27, and 45 is the greatest possible value.

## 2nd Variant

#