Digit Replacements
Source: 2024 AIME II #7
February 8, 2024
AIME II2024
Problem Statement
Let be the greatest four-digit integer with the property that whenever one of its digits is changed to , the resulting number is divisible by . Let and be the quotient and remainder, respectively, when is divided by . Find .