2001 APMO Problems/Problem 2
Problem
Find the largest positive integer so that the number of integers in the set
which are divisible by 3 is equal to the number of integers which are divisible by 5 or 7 (or both).
Solution
The equation
is equivalent to the problem statement. The period (of remainders of
) is the least common multiple of all denominators, which is
. We perform casework on an easier bound, namely
. Listing all lesser multiples of
:
Next, we number each of these values with a positive integer that describes by how much the left-hand side of the above equation is greater than the right-hand side:
Notice that
counts only once (since it is one number), but
and
all count twice (since they are on different sides of the equation, they cancel out).
Next, we list out until :
and we number the values again (initially
, since that is what we ended with):
Finally, we list out until
:
and we number the values:
(All of the above really make sense if you manipulate the equation such that it is equal to zero and set it to
in a Desmos graph.)
The difference should then repeat from but will start instead at
. Thus, it will never equate again (since the difference in the first cycle is never negative). As a result, the largest
such that the two sides are equal is
from our data above.