2024 AIME II Problems/Problem 7
Problem
Let be the greatest four-digit positive 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
.
Solution 1
We note that by changing a digit to for the number
, we are subtracting the number by either
,
,
, or
. Thus,
. We can casework on
backwards, finding the maximum value.
(Note that computing greatly simplifies computation).
Applying casework on , we can eventually obtain a working value of
. ~akliu