In AIME number theory, many problems hide a single integer behind two or more remainder clues. You might know that N leaves remainder 2 when divided by 5 and remainder 3 when divided by 7, but under exam time pressure the wrong move is to list numbers until one fits. The right move is to reconstruct N by substitution, then verify against the allowed answer range. This article focuses on the recovery step: how to turn two remainders into one integer efficiently, how to handle non-coprime moduli, and how to avoid off-by-one range errors. AIME answers are recorded as integers from 0 through 999. The mathematical reconstruction method below focuses only on the modular step.
Why AIME Modular Arithmetic Rewards Reconstruction
AIME problems often do not ask for the solution to a congruence system in abstract language. They ask for a number: the smallest positive integer, the number of objects, the missing digit, or the value that fits a range. Because the final answer must be an integer 0-999, you need both a correct congruence family and the specific representative selected by the problem's wording. Reconstruction is faster than brute force because it uses the structure of division.
Suppose N is congruent to a modulo m and N is congruent to b modulo n. The first statement says N = mk + a for some integer k. That single substitution turns the second congruence into a one-variable linear congruence. If m and n are coprime, there is one solution modulo mn. If they are not coprime, consistency requires a congruent to b modulo gcd(m,n). Many AIME-style traps are built around this consistency condition.
The Core Equation: From Two Remainders to One Variable
Start with the congruence with the larger modulus if you want fewer steps. Let N = mk + a. Substitute into the second congruence:
mk + a is congruent to b modulo n.
Rearrange:
mk is congruent to b - a modulo n.
If gcd(m,n)=1, multiply by the inverse of m modulo n. If gcd(m,n)=d is greater than 1, first check that d divides b-a. If it does not, no solution exists. If it does, divide the entire congruence by d to reduce to a coprime case. Then solve for k modulo n/d. Finally compute N = mk + a. Note that this gives you a base solution N0. The general solution is N = N0 + t * lcm(m,n).
This is the entire engine. The Chinese Remainder Theorem guarantees existence and uniqueness under coprime moduli, but you rarely need to quote the theorem in an AIME solution. You need the substitution.

Step-by-Step Method Using the Least Common Multiple
Use this checklist:
- Identify m, n, a, and b. Check gcd(m,n). If gcd is greater than 1, test whether b-a is divisible by gcd(m,n).
- Write N = mk + a, choosing the modulus that makes the arithmetic simplest, often the larger one.
- Solve the resulting linear congruence for k, choose the smallest nonnegative k, then compute N0.
- Determine the period L = lcm(m,n). The solutions are N0, N0+L, N0-L, etc.
The lcm tells you how often solutions repeat. If m=5 and n=7, every solution repeats by 35. If the problem asks for the smallest positive N, choose the smallest nonnegative k that gives N greater than 0. If the problem asks for a number between 1 and 999, you must find the specific member of the family N0 + tL that satisfies the additional constraints given in the text.
Teaching Illustration: Two Coprime Remainders
Teaching illustration, not an actual contest problem. Find the smallest positive integer N such that N is congruent to 2 modulo 5 and N is congruent to 3 modulo 7. Here m=5 and n=7 are coprime, and lcm=35.
Use the larger modulus 7. Let N = 7k + 3. Substitute into the first congruence:
7k + 3 is congruent to 2 modulo 5.
Since 7 is congruent to 2 modulo 5, this becomes 2k + 3 is congruent to 2 modulo 5. Subtract 3: 2k is congruent to -1, which is congruent to 4 modulo 5. Multiply by the inverse of 2 modulo 5, which is 3: k is congruent to 12, which is congruent to 2 modulo 5. The smallest nonnegative k is 2. Then N = 7(2)+3 = 17.
Check: 17 divided by 5 leaves remainder 2; 17 divided by 7 leaves remainder 3. The answer 17 is in the 0-999 range. The full solution set is 17 + 35t for integers t.
Notice what did not happen. We did not list numbers ending in 2 until one also had remainder 3 mod 7. We solved one linear congruence for k. That is the efficiency gain.
Teaching Illustration: Non-Coprime Remainders
Teaching illustration, not an actual contest problem. Find the smallest positive integer N such that N is congruent to 1 modulo 4 and N is congruent to 5 modulo 6. Here gcd(4,6)=2. The difference b-a = 5-1 = 4 is divisible by 2, so a solution exists.
Let N = 4k + 1. Substitute into the second congruence: 4k + 1 is congruent to 5 modulo 6, so 4k is congruent to 4 modulo 6. Divide the congruence by 2: 2k is congruent to 2 modulo 3. Since 2 is invertible modulo 3, k is congruent to 1 modulo 3. The smallest nonnegative k is 1, so N = 4(1)+1 = 5. Check: 5 mod 4 = 1 and 5 mod 6 = 5. The solution repeats modulo lcm(4,6)=12, so the solutions are 5 + 12t.
This example shows why the gcd check is not optional. If the original remainders had been N is congruent to 1 modulo 4 and N is congruent to 2 modulo 6, then b-a = 1, not divisible by gcd(4,6)=2, so no integer could satisfy both congruences. Recognizing that in one line saves minutes.
Verification Trick for AIME Answers
After computing N, plug it back into both original remainder statements. This catches arithmetic errors in the substitution. Then perform a second, independent check: confirm the answer is an integer from 0 through 999 and that it satisfies the problem's selection condition.
Do not stop at "it satisfies the congruences." AIME answers are not expressions like 17 + 35t. They are single integers. However, simply being in the 0-999 range is not enough to identify the correct answer if multiple members of the family fall within that range. You must re-read the problem for specific selection criteria, such as "smallest," "largest," or "divisible by X."
Common Pitfalls in AIME Modular Arithmetic
1. Forgetting the gcd consistency condition. If gcd(m,n) is greater than 1, the remainders must agree modulo that gcd. If they do not, no solution exists. If they do, reduce the problem carefully.
2. Dividing a congruence without checking divisibility. You can divide a congruence ax is congruent to b modulo n by d only when d divides a, b, and n. The safer route is to use the gcd condition and reduce the modulus correctly.
3. Using the product instead of the lcm. The solution repeats modulo lcm(m,n), not always mn. For coprime moduli they are equal; for non-coprime moduli they are not.
4. Confusing the answer range with a selection rule. AIME integer answers have a fixed range, but that range does not by itself select a unique member of a congruence family. Re-read the problem for constraints such as "smallest," "largest," or "divisible by X."
5. Reversing the substitution. If you write N = nk + b instead of N = mk + a, you must substitute into the other congruence. Mixing labels is the most common source of sign errors.
Choosing the Larger Modulus: A Small Heuristic
When you write N = mk + a, the modulus m multiplies k. If m is large, the final multiplication may be slightly larger, but the number of possible k values before reaching the target range is smaller. More importantly, choosing the larger modulus often makes the resulting congruence simpler because the variable k is being solved modulo the smaller modulus. For example, with moduli 5 and 7, use N = 7k + 3 and solve modulo 5. This keeps the linear congruence modulo 5. If you choose N = 5k + 2, you solve modulo 7, which is also fine, but arithmetic with 7 can be slightly less immediate. There is no universal rule; choose the representation that makes the inverse easy.
Range Selection: The Critical Step for Uniqueness
AIME answers are integers 0-999. This means after finding the full solution family N = N0 + L t, where L = lcm(m,n), you need the representative requested by the problem. It is crucial to understand that the answer format (0-999) does not automatically make the solution unique. Many families have multiple members in this range.
For the teaching illustration N is congruent to 2 modulo 5 and N is congruent to 3 modulo 7, N0 = 17 and L = 35. The solutions are 17, 52, 87, 122, 157, ... up to 997. All are valid integers in the 0-999 range.
- If the problem asked for the smallest positive integer, the answer is 17.
- If the problem asked for the largest solution below 100, the answer would be 87.
- If the problem asked for the smallest solution above 100, the answer would be 122.
- If the problem asked for a three-digit solution divisible by 11, you would impose that extra condition: 17+35t ≡ 0 (mod 11). Since 17 ≡ 6 and 35 ≡ 2 modulo 11, this gives 6+2t ≡ 0, so 2t ≡ 5 and t ≡ 8 modulo 11. Thus N=17+35(8)=297, which is divisible by 11.
The modular reconstruction gives the family; the wording selects the member. If the problem asks for a specific property, find the t that satisfies it rather than assuming the 0-999 range is enough.
Practice Strategy: Build Speed with Small Numbers
Before practicing full AIME problems, drill two-remainder reconstructions with small moduli. Use pairs such as mod 3 and mod 4, mod 5 and mod 7, and mod 4 and mod 6. For each pair, write the substitution, solve for k, compute N, and verify. Then identify the smallest positive member of the family N0 + tL. Doing ten of these mentally builds the pattern recognition that AIME speed requires.
When small examples feel automatic, increase the size of the remainders or moduli. The method does not change. The only additional work is arithmetic. This is also a good transition from AMC speed tactics to AIME sustained reasoning, as discussed in AIME Preparation After AMC: When to Switch From Speed to Sustained Reasoning. The goal is not to memorize cases but to trust a repeatable algorithm.
How Modular Reconstruction Connects to Other AIME Topics
Modular reconstruction often appears alongside polynomial remainders. A polynomial remainder problem may ask for a coefficient or constant that satisfies a congruence condition, and the same substitution logic applies. The linked article AIME Polynomial Remainders: Solving Without Expanding Every Term covers the polynomial side; use this article for the integer-recovery side. You can also combine modular thinking with counting problems, where the final count must be reported modulo a small number or placed in a specific residue class.
Answer checking is another natural companion. After finding N, verify that it satisfies both original statements and that it is the correct representative in the AIME range. A focused checklist for that final step appears in AIME Answer Checking: Catching Extraneous Roots Before Recording an Integer. Modular arithmetic rarely rewards rushing; it rewards a short, verifiable chain of arithmetic.
How to Avoid Arithmetic Errors Under Time Pressure
Write the substitution line clearly. Many errors come from skipping the intermediate congruence. If you go straight to a final N, you cannot debug. A three-line habit works well: first, N = mk + a; second, mk + a is congruent to b modulo n; third, mk is congruent to b - a modulo n. Then solve. Keep the original remainders visible. After computing N, check both remainders with division, not with mental modulo shortcuts. Finally, check the range and the specific selection criterion (smallest, largest, etc.).
If the problem gives more than two remainders, pair them one at a time. Solve the first two to get a combined congruence N is congruent to N0 modulo L. Then combine that with the third remainder. The method is identical, and the modulus becomes the lcm of the first two moduli. This is how AIME problems sometimes disguise a multi-step CRT problem as a word problem.

Frequently Asked Questions
Do I need to memorize the Chinese Remainder Theorem formula?
No. For AIME modular arithmetic, the constructive substitution method is usually faster and less prone to memory errors than recalling a general formula.
What if the moduli are not coprime?
First check whether the remainders agree modulo the gcd of the moduli. If they do not, no solution exists. If they do, reduce the congruence correctly and solve the remaining linear congruence.
Does the 0-999 answer range make the solution unique?
No. The range only limits which representatives can be recorded. You still need the problem's own selection condition, such as "smallest positive" or "divisible by 11," to choose the unique member of the congruence family. Then verify that the chosen integer satisfies both original remainder conditions.
