Systems of Congruences
If the moduli are pairwise coprime, a system has a unique solution modulo .
In plain terms. Several "remainder" conditions with no shared factors always combine into a single condition — one remainder mod the product.
Example. and give (check: and ).
Why it works. For coprime and , look at the numbers and record each one's pair of remainders (mod , mod ). Two numbers with the same pair differ by a multiple of both and , hence of , so no pair is repeated. There are exactly possible pairs, so every pair occurs exactly once: each system has a solution, and it is unique mod . To FIND it, solve one congruence, substitute the general solution into the next, and repeat.
Find the least positive integer with , and .
Spotting it. Pairwise coprime moduli with product : there is exactly one answer below , and substitution finds it one congruence at a time.
Step 1. . Mod : . Since , , so .
Step 2. . Mod : and , so and .
Step 3. . Check: ✓
Find the remainder when is divided by .
Spotting it. Mod is two easier problems: mod and mod , which are coprime. Solve each, then glue with CRT.
Step 1. Mod : , so .
Step 2. Mod : , so . Build it up: , , , , and .
Step 3. Find with : try ; the remainders mod are . So the answer is .
Applying CRT to moduli that share a factor. and has NO solution: the first says is odd, the second that is even. When moduli are not coprime, the system is solvable only if the congruences agree modulo the gcd, and then the answer is unique only modulo the lcm.
Find the least positive integer that leaves remainder when divided by each of and is divisible by .
Show the answerHide the answer
Remainder on division by means is a multiple of , so . The first multiple of is .
Orders and Totients
If , then , where .
In plain terms. Like Fermat but for any modulus: raising to the "totient power" resets to . The totient counts how many numbers below share no factor with it.
Example. , so .
Why it works. List the numbers below that are coprime to and multiply each by . The products are still coprime to and are all different mod (if then , because is invertible), so they are the same list in a new order. The two lists have the same product, so , and cancelling the product (which is invertible) leaves .
The order of mod is the least with , and it always divides .
In plain terms. It is the length of the repeating cycle of powers of — and that length must divide the totient, which narrows the possibilities.
Example. Order of mod : , so the order is , which divides .
Why the order divides . Let be the order. Divide: with . Then , and forces by the minimality of . The same argument shows exactly when , which is what makes towers of exponents manageable.
Find the remainder when is divided by .
Spotting it. The base has order mod (), so only the exponent mod matters. The exponent is itself a power of , and .
Step 1. .
Step 2. So .
How many digits are in the repeating block of the decimal for ? And for ?
Spotting it. For coprime to , the decimal of repeats with period equal to the ORDER of mod : the remainders of long division are the powers of mod .
Step 1. The order of mod divides . Test small divisors: , , . So the period is (indeed ).
Step 2. . The order of mod is (). A power of is mod exactly when it is mod and mod , i.e. when the exponent is a multiple of both and . The period is .
Using as if it were the period. is true, but the repeating block of has digits, not : Euler gives a multiple of the order, not the order itself. When the question is about the LEAST exponent, test the divisors of .
Find the remainder when is divided by .
Show the answerHide the answer
The order of mod is ( and no smaller power works: ). So reduce the exponent mod : is odd and divisible by , so . Then .
Valuations, Divisor Sums and Digits
; trailing zeros of count .
Why it works. Count the factors of in by rows instead of by numbers: every multiple of contributes one, every multiple of one more, and so on. Row has entries.
ends in zeros, because fives are scarcer than twos. AIME versions ask for the power of a prime in a binomial coefficient, where Kummer's theorem — the exponent equals the number of carries when adding in base — turns the computation into base- addition.
, , and both are multiplicative across coprime factors.
So and . Problems asking for "the number of divisors of that are perfect squares" restrict each exponent to even values, giving — the same product with a floor, and that pattern answers most divisor-counting variants.
How many zeros does end in?
Step 1 — zeros come from factors of , and twos are plentiful, so count fives.
Step 2 — .
Step 3 — so ends in zeros.
Find the largest such that divides .
Spotting it. , so its -adic valuation is , and Legendre computes each piece.
Step 1. .
Step 2. .
Step 3. , so .
Check with Kummer: , and adding produces a carry in each of the four places, so the valuation is ✓
Find the sum of the odd positive divisors of .
Spotting it. An odd divisor uses no factor of , so the odd divisors of are exactly the divisors of .
Step 1. .
Stopping Legendre's sum too early. For , misses the multiple of , which carries a THIRD factor of ; the true count is . Keep dividing until the power of exceeds .
How many divisors of are perfect squares?
Show the answerHide the answer
. Even exponents: choices for the s (), for the s (), for the — square divisors.