CEMC 2025 Gauss 8 Problem 23
/ 5 min read
Table of Contents
2025 CEMC Gauss 8 Problem 23
What is the sum of the digits of the smallest positive integer that ends in and is divisible by ?
Theoretical Solution
The CEMC Gauss 8 has historically been a very easy 8th grade test. For example, Problem 5 on the 2017 exam was ” is equal to…”. So this question sort of came as a surprise when I heard it.
The brute-force solution might look something like this: We need to figure out how many multiples of we can add on to so our number is still divisible by . This is equivalent to solving the following congruence relation:
So this is equivalent to finding the modular inverse of mod . Note that you’re allowed to use a calculator on this exam, so this isn’t as hard as you might think. Euclidean Algorithm gives us:
Back substitution gives:
Since , the modular inverse of mod is . Putting this back into our original congruence gives:
So and our number final number is , the sum of the digits being .
Contest Solution
This struck me as a tall ask for a test where just a few problems earlier asks basic multiplication facts. How many 8th graders know how to compute large modular inverses using Extended Euclidean Algorithm? So what’s going on here? My first inclination was to note the prime factorization of :
is clearly the most difficult of the three factors to work with, so let’s focus on that. Since we’re sort of trying to see how many multiples of we can add to , I looked at how close was to dividing . Interestingly, , which is a really cool piece of information. If we start with any number and instead of adding we add , this will have the effect of reducing whatever remainder mod 61 we started with by 4. Since , we can add exactly to this to end up with a number that’s exactly divisible by .
Cool, so is divisible by . It’s also coincidentally divisible by . It is not, however, divisible by . How do we solve this? Well if we continue to add multiples of our number will continue to be divisible by and eventually be divisible by both and . We can be more precise though: adding one multiple of breaks our divisibility by unless we add three multiples of , or . In other words all numbers of the following form are divisible by and :
Finally, we could note that and and realize we only need to add one instance of to arrive at our answer. Or since, you know, we’re allowed to use a calculator we can just try incrementing our by until we get something that works. And guess what: we only need to try once! is indeed divisible by 2013.
Alternative Idea
I almost like my second solution, but I don’t like how we had to stumble upon the magic piece of information . Here’s another way to proceed using only elementary ideas. As before, we want to find the smallest number ending in that is divisible by . To do this, we can use a lesser-known divisibility rule for :
Let’s denote the unknown leading digits by , so our number is of the form . We’ll apply the rule step by step:
Thus is the smallest number divisible by and we proceed as before.
Conclusion
I’m still unsatisfied with this and I feel like I’m missing a better way to approach this problem as an 8th grader in a time-sensitive situation.