Recently I have seen an interesting math problem from primary student level. In surface, it seems trivial but it revealed stunning and interesting mathematic analytical process. I am going to share my experience on that. First of all, this is the problem.
The Problem
Take a deep breath and pause as long as you want to solve this question. It’s not easy. If you are ready or you manage to give up. Please read along…
The solution coming…
The solution coming…
The solution coming…
The Solution
In short, it tells you a rule of thumb to handle this kind of question. For such kind of number XYZABC, if (sum XYZ and ABC) mod divisor equals 0
aka exact division
then concludes that XYZABC / divisor is an exact division
. In this problem, the answer is 573426 because (573 + 426) mod 999 is 0 aka exact division. Done.
But in terms of the slide of conclusion, I am skeptical because:
- Is it a generalized “law” for every XYZABC over DEF?
- Given a special case, 999999 over 999 is an exact division, also according to XYZ + ABC then 999 + 999 equals 1998 which is also exact division for 999 (quotient is 2, remainder is 0).
- Also another special case, 999000 over 999 is an exact division too. It also matches XYZ + ABC over DEF is an exact division, then the whole number XYZABC over DEF is also exact division.
- It shows a beautiful symmetry a 6-digit number over a 3-digit number, then first 3 digits + last 3 digits.
- What if 99900 over 999? 99 + 900 equals 999, which is also an exact division for 999. Hence, obviously 99900 over 999 is an exact division. This is the 3rd special case.
- I can’t enumerate any more special cases where 6-digit numbers have tons of tries. It’s daunting and can’t prove this is a generalized law. Maybe they are just coincidences for 999999, 999000 and 99900 over 999. On the other hand, it is like a hindsight that I know the XYZ + ABC can exactly divide DEF, then succeed luckily 3 special cases. In math, it is not convincing.
Proving Process from DeepSeek
I am struggled to prove the so-called law “截断做和”. So I feed the problem to the popular star DeepSeek of LLM recently. Surprisingly, DeepSeek performs a incredible, self-correcting logical processing on the problem in a very short time. Make sure you enable R1 so that DeepSeek can output the verbose thinking process. It’s really astonishing.
How I Deeply Dive into DeepSeek’s Proof
I quote the key proof from DeepSeek:
Do not be freak out by those math symbols, I will explain progressively.
We want to prove that for N can be exactly divided by a 999 when A + B is also exactly divided by 999, so that N MUST BE exactly divided by 999. This is generalized to every number.
We want to figure a 6-digit number N can be exactly divided by 999. So N can be written into N = 1000 * A + B. TBH, this is a bit tricky, why do we pick first 3 digits and last 3 digits, but here maybe talking about a heuristic for a mathematician because the divider 999 is a 3-digit number and a dividend is a 6-digit number, they show a beautiful symmetry to lead to a thought that we transform the 6-digit number to be two groups: first 3 digit and last 3 digit for luck. In fact, DeepSeek’s processing is doing so.
Step 2 - Get rid of 1000 from the equation
In N = 1000 * A + B, if we can get rid of this number 1000, then that is perfect to the target (A + B) / 999 is an exact division. How to get rid of the factor 1000 becomes the current task. Here, 2 math theories about modulo (aka mod for short) and congruence modulo come into play.
Step 2.1 - What is modulo?
Modulo is a simple math concept that reveals another side of a division. It’s not a difficult concept.
An ordinary division, the operator is dividend ÷ divisor = quotient.
On the other hand of modulo, the operator is dividend mod divisor = remainder.
For example, dividend is 101 and divisor is 10, we have
101 ÷ 10 = 10 and
101 mod 10 = 1
A special rule is that if the dividend less than the divisor, the mod operation result is the dividend itself.
For example, 1 mod 999 since 1 < 999 so that the result is 1. Simple, isn’t it?
Step 2.2 - What is congruence modulo?
Congruence modulo is denoted using ≡
. It represents two numbers that share the same remainder.
For example, 1000 and 1, if they divide by 999, they result in the same remainder 1. In math, we denote that as 1≡1000(mod 999) where both 1 and 1000 over 999 result the same remainder 1.
Step 3 - OK, get back to prove the solution
Back to proving if A + B can be exactly divided by 999, then N is also exactly divided by 999. We have N = 1000 * A + B now, trying to get rid of 1000.
Since 1≡1000(mod 999) and logically 1*A≡1000*A(mod 999) by a law of congruence modulo. Because even though 1 and 1000 are times A, the effect is that their remainders are expanding equally A times. Imagine A = 10, so 10 and 10000 over 999, the remainder is 10 for both cases.
Then we can continue to add B in the equation, we get A + B≡1000A + B(mod 999). That is also true where their remainder are increasing equally plus B, the same.
At this point of time, simply we replace N with 1000A + B, we have the finally result A + B≡N(mod 999).
Translate that into Chinese - “有这层关系A+B和N对于除数999同余,而A是N的前三位,B是N的后三位,如果A+B整除999(就是余数是0),因为和N同余的关系,N也可以整除999, 所以A+B=999, 按照题目必须是573426!”
Step 4 - Final thought
All in all, this problem is just a well-crafted math gimmick. Think about it, the prerequisite has to have divisor is either 999 or 99 something because 1 and 1000 are congruence modulo against 999 but not other number even 998, so that we can assert 1≡1000(mod 999) or 1≡100(mod 99) then perform the brave move to replace 1000 or 100 with 1. And lastly, it ends up with the assertion N≡A+B(mod 999), which is dramatic.
Summary
Thanks for finishing reading this blog at this point. I hope you could probably get out of something like
- Modulo
- Congruent modulo
- Mathematical analytical thinking
- DeepSeek(or other LLM models) is really incredible. It should be your company in the course of learning anything. I am delighted to see how much impact it will reshape the learning paradigm of human being.