skip to content
Logo Sons Only Take After Their Fathers' Negative Attributes

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 20252025 and is divisible by 20132013?

Theoretical Solution

The CEMC Gauss 8 has historically been a very easy 8th grade test. For example, Problem 5 on the 2017 exam was ”44×2244\times 22 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 10,00010,000 we can add on to 20252025 so our number is still divisible by 20132013. This is equivalent to solving the following congruence relation:

10000k+20250(mod2013)10000k2025(mod2013)\begin{align*} 10000k + 2025 &\equiv 0 \pmod{2013}\\ \Rightarrow\quad 10000k &\equiv -2025 \pmod{2013} \end{align*}

So this is equivalent to finding the modular inverse of 1000010000 mod 20132013. 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:

10000=4×2013+19482013=1×1948+651948=29×65+6365=1×63+263=31×2+12=2×1+0\begin{align*} 10000 &= 4 \times 2013 + 1948 \\ 2013 &= 1 \times 1948 + 65 \\ 1948 &= 29 \times 65 + 63 \\ 65 &= 1 \times 63 + 2 \\ 63 &= 31 \times 2 + 1 \\ 2 &= 2 \times 1 + 0 \end{align*}

Back substitution gives:

1=63312=6331(65163)=32633165=32(19482965)3165=32194895965=321948959(201311948)=99119489592013=991(1000042013)9592013=9911000049232013\begin{align*} 1 &= 63 - 31 \cdot 2 \\ &= 63 - 31 \cdot (65 - 1 \cdot 63) = 32 \cdot 63 - 31 \cdot 65 \\ &= 32 \cdot (1948 - 29 \cdot 65) - 31 \cdot 65 = 32 \cdot 1948 - 959 \cdot 65 \\ &= 32 \cdot 1948 - 959 \cdot (2013 - 1 \cdot 1948) = 991 \cdot 1948 - 959 \cdot 2013 \\ &= 991 \cdot (10000 - 4 \cdot 2013) - 959 \cdot 2013 = 991 \cdot 10000 - 4923 \cdot 2013 \end{align*}

Since 1=99110000492320131 = 991 \cdot 10000 - 4923 \cdot 2013, the modular inverse of 1000010000 mod 20132013 is 991991. Putting this back into our original congruence gives:

10000k2025(mod2013)k991(12)(mod2013)k11892(mod2013)k186(mod2013)\begin{align*} \quad 10000k &\equiv -2025 \pmod{2013} \\ \quad k &\equiv 991 \cdot (-12) \pmod{2013} \\ \quad k &\equiv -11892 \pmod{2013} \\ \quad k &\equiv 186 \pmod{2013} \end{align*}

So k=186k=186 and our number final number is 18620251862025, the sum of the digits being 24\boxed{24}.

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 20132013:

2013=311612013 = 3\cdot11\cdot61

6161 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 1000010000 we can add to 20252025, I looked at how close 6161 was to dividing 1000010000. Interestingly, 16461=10004164\cdot61=10004, which is a really cool piece of information. If we start with any number and instead of adding 1000410004 we add 1000010000, this will have the effect of reducing whatever remainder mod 61 we started with by 4. Since 202512(mod61)2025\equiv12\pmod{61}, we can add exactly 3000030000 to this to end up with a number that’s exactly divisible by 6161.

Cool, so 3202532025 is divisible by 6161. It’s also coincidentally divisible by 33. It is not, however, divisible by 1111. How do we solve this? Well if we continue to add multiples of 610000610000 our number will continue to be divisible by 6161 and eventually be divisible by both 33 and 1111. We can be more precise though: adding one multiple of 610000610000 breaks our divisibility by 33 unless we add three multiples of 610000610000, or 18300001830000. In other words all numbers of the following form are divisible by 33 and 6161:

1830000k+320250(mod361)1830000k+32025\equiv0\pmod{3\cdot61}

Finally, we could note that 320254(mod11)32025\equiv4\pmod{11} and 18300007(mod11)1830000\equiv7\pmod{11} and realize we only need to add one instance of 18300001830000 to arrive at our answer. Or since, you know, we’re allowed to use a calculator we can just try incrementing our 3202532025 by 18300001830000 until we get something that works. And guess what: we only need to try once! 18620251862025 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 16461=10004164\cdot61=10004. Here’s another way to proceed using only elementary ideas. As before, we want to find the smallest number ending in 20252025 that is divisible by 6161. To do this, we can use a lesser-known divisibility rule for 6161:

Let’s denote the unknown leading digits by xx, so our number is of the form x2025\overline{x}2025. We’ll apply the rule step by step:

x2025x20265=x172x1762=x05x065=x030x30(mod61)x3(mod61)\begin{align*} \overline{x}2025 &\rightarrow \overline{x}202 - 6 \cdot 5 = \overline{x}172 \\ &\rightarrow \overline{x}17 - 6 \cdot 2 = \overline{x}05 \\ &\rightarrow \overline{x}0 - 6 \cdot 5 = \overline{x}0 - 30 \\ &\Rightarrow x - 3 \equiv 0 \pmod{61} \\ &\rightarrow x \equiv 3 \pmod{61} \end{align*}

Thus 3202532025 is the smallest number divisible by 6161 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.