All lessons / Number Theory

Number Theory — What whole numbers are made of.

About this topic

Number theory is the part of math about whole numbers — 1, 2, 3, … — and how they break apart into smaller whole numbers. It's the oldest branch of math. The Greeks did number theory 2500 years ago. You'll do some of it on the AMC.

Typically 3–5 problems on every AMC 8 are number theory (more in recent years): maybe a divisibility test ("is this number a multiple of 7?"), a prime question ("sum of two primes"), or a units-digit puzzle ("what's the last digit of 9 to the 100th power?"). Each of these has a fast method once you know the trick.

This lesson teaches the 9 most useful number-theory ideas. Take your time with each chapter — the ideas build on each other. Primes power the factor tree, the factor tree powers GCD and LCM, and so on.

CHAPTER 1

Divisibility rules — test without dividing

THEORY

Divisible means "divides evenly with no remainder." 12 is divisible by 3 because 12 ÷ 3 = 4 exactly. 13 is not divisible by 3 because 13 ÷ 3 leaves a remainder of 1.

You could test divisibility by actually doing the division — but for every common divisor (2, 3, 4, 5, 6, 8, 9, 10, 11), there's a shortcut rule that lets you check just by looking at the digits. Memorize these. They show up everywhere on AMC 8.

DIVISIBILITY RULES (memorize all)

  • By 2: the last digit is 0, 2, 4, 6, or 8 (even). Example: 358 ✓ (ends in 8); 359 ✗.
  • By 5: the last digit is 0 or 5. Example: 1745 ✓; 1746 ✗.
  • By 10: the last digit is 0. Example: 250 ✓; 251 ✗.
  • By 4: the last two digits form a number divisible by 4. Example: 132 ✓ (32 is 4×8); 130 ✗.
  • By 8: the last three digits form a number divisible by 8. Example: 9104 ✓ (104 = 8×13); 9100 ✗.
  • By 3: add up all the digits — if that sum is divisible by 3, the number is too. Example: 471: 4+7+1 = 12, which is 3×4 ✓.
  • By 9: same as 3 but for 9. Example: 5238: 5+2+3+8 = 18 = 9×2 ✓.
  • By 6: the number must be divisible by both 2 and 3 — use both rules above.
  • By 11: take the digits in alternating signs (+, −, +, −, …) and add them. If that total is 0 or a multiple of 11, the number is divisible by 11. Example: 8074: 8 − 0 + 7 − 4 = 11 ✓.

The weird rules — divisibility by 7 and 13

The rules for 7 and 13 don't look anything like the others. They feel like party tricks. They are party tricks — but they work, and competition kids who know them save real time.

DIVISIBILITY BY 7 — "chop, double, subtract"

  1. Chop off the LAST digit.
  2. DOUBLE it.
  3. SUBTRACT that from what's left.
  4. If the result is divisible by 7 (including 0 or a negative multiple), the original number is too. If still big, repeat.

Examples.

  • Is 161 divisible by 7? Chop the 1: leaves 16. Double the 1: 2. Subtract: 16 − 2 = 14. Yes, 14 = 7·2 ✓. (And 161 = 7·23.)
  • Is 203 divisible by 7? Chop 3, double = 6, subtract from 20: 20 − 6 = 14 ✓.
  • Is 1,729 divisible by 7? Chop 9, double = 18. 172 − 18 = 154. Still big — repeat. Chop 4, double = 8. 15 − 8 = 7 ✓. So 1729 is divisible by 7.

DIVISIBILITY BY 13 — "chop, times 4, ADD"

  1. Chop off the LAST digit.
  2. MULTIPLY it by 4.
  3. ADD to what's left.
  4. If the result is divisible by 13, the original is too. Repeat if big.

Examples.

  • Is 169 divisible by 13? Chop 9, times 4 = 36. 16 + 36 = 52 = 13·4 ✓. (And 169 = 13².)
  • Is 1001 divisible by 13? Chop 1, times 4 = 4. 100 + 4 = 104 = 13·8 ✓.

The 1001 magic — one trick for 7, 11, AND 13

Here's a fact every AMC kid should memorize:

1001 = 7 × 11 × 13

This single identity unlocks a SHARED divisibility test for all three of those primes:

1001-TRICK (works for 7, 11, AND 13)

  1. Split the number into 3-digit groups starting FROM THE RIGHT (the rightmost group can have fewer digits).
  2. Take the ALTERNATING SUM of those groups (right minus next minus +next…).
  3. If the alternating sum is divisible by 7, 11, or 13, the original is too.

Example. Is 247,247 divisible by 7, 11, and 13?

  • Groups from the right: 247 and 247.
  • Alternating sum: 247 − 247 = 0.
  • 0 is divisible by everything, so 247,247 is divisible by all of 7, 11, and 13 ✓.

This is exactly the famous "6-digit ABCABC trick" (used in amc8-2017-07): any number that repeats a 3-digit block — like 247247 or 854854 — equals abc · 1001, so it's automatically divisible by 7, 11, AND 13.

247247=247 × 1001and1001 = 7 · 11 · 13so 247247 is automatically divisible by 7, 11, and 13.

Be honest with yourself. If you're going to memorize ONE "weird" fact, make it 1001 = 7·11·13. The chop-double-subtract rule for 7 and the chop-times-4-add rule for 13 are bonus tricks for showing off — useful sometimes, but the 1001 identity is the one that pays off on real AMC problems.

Why does the rule work? Just look. 👀

Here are the first 10 multiples of 9. Add the digits of each one:

9 × 1 = 999 × 2 = 18→ 1 + 8 =99 × 3 = 27→ 2 + 7 =99 × 4 = 36→ 3 + 6 =99 × 5 = 45→ 4 + 5 =99 × 6 = 54→ 5 + 4 =99 × 7 = 63→ 6 + 3 =99 × 8 = 72→ 7 + 2 =99 × 9 = 81→ 8 + 1 =99 × 10 = 90→ 9 + 0 =9

Always 9. Not a trick — a pattern.

For bigger numbers, the digit sum might be 18 or 27 or 36 instead — but those are all multiples of 9 too. So the rule still works:

  • 144 → 1+4+4 = 9 ✓ (144 = 9×16)
  • 198 → 1+9+8 = 18 ✓ (18 is 9×2)
  • 999 → 9+9+9 = 27 ✓ (27 is 9×3)
If the digits add to a multiple of 9, the number is a multiple of 9.
🎯 Try it
What do the digits of 234 add to? (And: is 234 a multiple of 9?)
Walkthrough: 2 + 3 + 4 = 9. Since 9 is a multiple of 9, yes — 234 is divisible by 9. Check: 234 ÷ 9 = 26. ✓
For older kids: where does this pattern come from?

It comes from the fact that 10 is just 9 + 1. And 100 is 99 + 1, and 1000 is 999 + 1. Each of 9, 99, 999, … is itself divisible by 9.

So for a number like 471: the 400 is “4 piles of 99, plus 4 extra.” The 70 is “7 piles of 9, plus 7 extra.” The 1 is just 1. Pulling out all the “piles of 9 or 99”, what's left is 4 + 7 + 1 = 12 — the digit sum.

In symbols: 471 = 4(99+1) + 7(9+1) + 1 = (4·99 + 7·9) + (4+7+1). The first chunk is built only from multiples of 9, so it doesn't change whether 471 is a multiple of 9. All that matters is the digit sum.

THE TRICK

When a problem tells you something is divisible by k and asks for an unknown digit, use the rule for k to figure out what the missing digit must be.

Example. Find the digit ? so that 1?2 is divisible by 9. By the rule, the digit sum 1 + ? + 2 must be a multiple of 9. So 3 + ? needs to equal 9, 18, 27, …. The only single-digit choice is ? = 6. Check: 162 ÷ 9 = 18 ✓.

Another. Find ? so that 43?2 is divisible by 4. Only the last two digits matter (rule for 4), so we need ?2 divisible by 4. Test by the tens digit: for ? ∈ {1, 3, 5, 7, 9} the last two digits are 12, 32, 52, 72, 92 — all divisible by 4 ✓. For ? ∈ {0, 2, 4, 6, 8} the last two digits are 02, 22, 42, 62, 82 — none are divisible by 4 ✗. So the five odd choices of ? work, giving five answers.

WORKED EXAMPLE
PROBLEM · 2017 #8

Malcolm wants to visit Isabella after school today and knows the street where she lives but doesn't know her house number. She tells him, "My house number has two digits, and exactly three of the following four statements about it are true."

  1. It is prime.
  2. It is even.
  3. It is divisible by 7.
  4. One of its digits is 9.

This information allows Malcolm to determine Isabella's house number. What is its units digit?

A) 4 B) 6 C) 7 D) 8 E) 9

Malcolm is told: "My house number has two digits, and exactly three of the following four statements about it are true: (1) it is prime, (2) it is even, (3) it is divisible by 7, (4) one of its digits is 9."

Three statements are true; exactly one is false. The number is two digits.

Statements (1) prime and (2) even can't both be true — the only even prime is 2, which isn't two digits. So one of them is the false one.

Try the case where (1) is false (the number is not prime). Then (2), (3), (4) are all true: the number is even, divisible by 7, and has a 9 as one of its digits.

Even + divisible by 7 → divisible by 14. Two-digit multiples of 14: 14, 28, 42, 56, 70, 84, 98. Which one has a 9 as a digit? Only 98.

Check: 98 = 2 · 7² — not prime ✓, even ✓, divisible by 7 ✓, contains 9 ✓. Three true, one false ✓.

The units digit of the house number is 8.

The trick is to use divisibility rules to narrow a list. "Even + divisible by 7" doesn't mean two separate checks — it means divisible by 14. Then there are only seven two-digit candidates instead of 90, and the digit-9 condition picks one.

Answer: D — 8.
RULE OF THUMB

Don't long-divide. Use the rules. For ones digit → mod 2, 5, 10. For last two digits → mod 4. For digit sum → mod 3, 9. For alternating sum → mod 11. For 7 → chop, double, subtract. For 13 → chop, ×4, add. For 7/11/13 together → use that 1001 = 7·11·13 (3-digit groups, alternating sum).

MORE LIKE THIS
2017 · #7 Let Z be a 6-digit positive integer, such as 247247, whose first three digits are the same as its last three digits taken in the same...

Let Z be a 6-digit positive integer, such as 247247, whose first three digits are the same as its last three digits taken in the same order. Which of the following numbers must also be a factor of Z?

Show answer
Answer: A — 11.
Show hint
Hint 1
Write Z = abcabc as a multiple of abc. The multiplier factors into nice primes.
Show solution
Approach: abcabc = 1001 · abc
  1. Z = abcabc = abc · 1001.
  2. 1001 = 7 · 11 · 13. So 11 is always a factor of Z.
2005 · #18 How many three-digit numbers are divisible by 13?

How many three-digit numbers are divisible by 13?

Show answer
Answer: C — 69.
Show hint
Hint 1
Three-digit multiples of 13: smallest is 13 · 8 = 104. Largest is 13 · 76 = 988. Count from 8 to 76.
Show solution
Approach: find smallest and largest multipliers
  1. Smallest 3-digit multiple: 13 · 8 = 104. Largest: 13 · 76 = 988.
  2. Multipliers 8 through 76: 76 − 8 + 1 = 69.
2016 · #5 The number N is a two-digit number.When N is divided by 9, the remainder is 1.When N is divided by 10, the remainder is 3.What is the...

The number N is a two-digit number.

  • When N is divided by 9, the remainder is 1.
  • When N is divided by 10, the remainder is 3.

What is the remainder when N is divided by 11?

Show answer
Answer: E — Remainder 7.
Show hints
Hint 1 of 2
Remainder 3 mod 10 means N ends in 3. So N ∈ {13, 23, 33, …, 93}.
Still stuck? Show hint 2 →
Hint 2 of 2
Which of those leaves remainder 1 when divided by 9? Sum of digits gives the answer fast (sum ≡ N mod 9).
Show solution
Approach: narrow to last-digit-3, then check mod 9
  1. Last digit 3, so N ∈ {13, 23, 33, 43, 53, 63, 73, 83, 93}.
  2. Sum-of-digits test for mod 9: only 73 has digit sum 10 ≡ 1 (mod 9). So N = 73.
  3. 73 mod 11: 11 × 6 = 66, remainder 7. Answer: 7.
2024 · #5 Aaliyah rolls two standard 6-sided dice. She notices that the product of the two numbers rolled is a multiple of 6. Which of the...

Aaliyah rolls two standard 6-sided dice. She notices that the product of the two numbers rolled is a multiple of 6. Which of the following integers cannot be the sum of the two numbers?

Show answer
Answer: B — The sum cannot be 6.
Show hints
Hint 1 of 2
The product is a multiple of 6 only when the two dice meet a special condition. Test each answer choice against it.
Still stuck? Show hint 2 →
Hint 2 of 2
A product is a multiple of 6 only if the pair contains a 3 or 6 (factor of 3) and an even number (factor of 2). Just test the answer choices against that.
Show solution
  1. The pair must include a multiple of 3 (a 3 or a 6) and an even number.
  2. Sum 6 comes only from (1,5), (2,4), (3,3) — products 5, 8, 9, none a multiple of 6. So 6 is impossible.
  3. Every other choice has a good pair: 5 = (2,3)→6, 7 = (1,6)→6, 8 = (2,6)→12, 9 = (3,6)→18.
Another way — list every valid pair (MAA):
  1. Pairs whose product is a multiple of 6 (need a multiple of 3 and an even number): (1,6), (2,3), (2,6), (3,6), (4,6), (5,6), (6,6).
  2. Their sums: 7, 5, 8, 9, 10, 11, 12. Among A–E, only 6 is missing.
2000 · #11 The number 64 has the property that it is divisible by its units digit. How many whole numbers between 10 and 50 have this property?

The number 64 has the property that it is divisible by its units digit. How many whole numbers between 10 and 50 have this property?

Show answer
Answer: C — 17.
Show hints
Hint 1 of 2
Group the numbers by their units digit and test divisibility.
Still stuck? Show hint 2 →
Hint 2 of 2
Units digit 1, 2, or 5 always works; 0 never does (no division by 0).
Show solution
Approach: casework on the units digit
  1. Units digit 1, 2, and 5 each give 4 working numbers (12 total). Then 33 (digit 3), 24 and 44 (digit 4), 36 (digit 6), and 48 (digit 8) work; digits 0, 7, 9 give none.
  2. Total = 12 + 1 + 2 + 1 + 1 = 17.
1994 · #6 The units digit (one's digit) of the product of any six consecutive positive whole numbers is

The units digit (one's digit) of the product of any six consecutive positive whole numbers is

Show answer
Answer: A — 0.
Show hints
Hint 1 of 2
Among six consecutive numbers, what's guaranteed to appear?
Still stuck? Show hint 2 →
Hint 2 of 2
A multiple of 5 and an even number together make a multiple of 10.
Show solution
Approach: the product is a multiple of 10
  1. Any six consecutive numbers include a multiple of 5 and at least one even number.
  2. Their product is therefore a multiple of 10, so its units digit is 0.
CHAPTER 2

Primes — the building blocks

THEORY

A prime number is a whole number greater than 1 that you CAN’T break into a multiplication of smaller whole numbers. Its only divisors are 1 and itself.

The opposite is composite — it can be split. 6 = 2 × 3, so 6 is composite. 7 can’t be split, so 7 is prime.

Here’s the picture: imagine arranging n dots into a rectangle. If you can ONLY form a 1-by-n strip, the number is prime. If you can form a fatter rectangle, it’s composite.

7 dots — only a 1×7 strip fits.PRIME ✓12 dots — lots of rectangles work.COMPOSITE ×3 × 43 × 4 again2 × 6

The first 15 primes — memorize on sight

Below 50 there are exactly 15 primes. Color them red on the 1–50 grid:

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495015 primes ≤ 50. Notice: after 2, every prime is odd. Primes thin out as numbers get bigger.

Three facts you’ll use again and again

FactWhy it matters
1 is NOT prime.It has only one divisor (itself), not two. Don’t call it the “smallest prime.”
2 is the ONLY even prime.Every other even number splits as 2 × (something). HUGE for “sum of two primes” problems.
Primes go on forever.Euclid proved this 2300 years ago. They thin out but never stop.

How to test if n is prime — the √n shortcut

You don’t need to try every divisor up to n − 1. Just primes up to √n. Why? Because if n = a × b with both factors bigger than √n, the product would overshoot n — impossible. So at least one factor must be small.

Is 53 prime?   √53 ≈ 7.3 — only test 2, 3, 5, 7.53 ÷ 2not whole (53 is odd)53 ÷ 3not whole (5+3=8, not ÷3)53 ÷ 5not whole (doesn’t end in 0 or 5)53 ÷ 7not whole (7×7=49, 7×8=56)⇒ 53 is PRIME ✓
THE TRICK

The only-even-prime-is-2 rule is huge. Whenever a problem asks about a sum of two primes equaling an odd number, one of them must be 2 (because odd = even + odd, and the even one has to be 2 since 2 is the only even prime).

Example. Can 41 be the sum of two primes? Since 41 is odd, one prime is 2, the other must be 41 − 2 = 39 = 3·13. Not prime. So 41 cannot be written as a sum of two primes.

WORKED EXAMPLE
PROBLEM · 2014 #4

The sum of two prime numbers is 85. What is the product of these two prime numbers?

A) 85 B) 91 C) 115 D) 133 E) 166

The sum is 85, which is odd. So one of the two primes is even — that means it's 2.

The other prime: 85 − 2 = 83. Is 83 prime? Check √83 ≈ 9.1, so test 2, 3, 5, 7. 83 is odd, digit sum 11 (not a multiple of 3), doesn't end in 0 or 5, and 83 ÷ 7 ≈ 11.86 — not whole. So yes, 83 is prime ✓.

The two primes are 2 and 83. Their product: 2 × 83 = 166.

Parity (odd vs. even) is your first move in any prime problem. "Odd target = sum of two primes" forces one of them to be 2.

Answer: E — 166.
RULE OF THUMB

Know primes up to 50 by sight. The only even prime is 2 — use it whenever the puzzle involves an odd target. To check if a number is prime, test divisibility by primes up to √n.

MORE LIKE THIS
2003 · #2 Which of the following numbers has the smallest prime factor?

Which of the following numbers has the smallest prime factor?

Show answer
Answer: C — 58 (its smallest prime factor is 2).
Show hint
Hint 1
No prime is smaller than 2 — which of these has 2 as a factor?
Show solution
Approach: the smallest prime is 2
  1. A prime factor can't be smaller than 2, and only even numbers have 2 as a factor.
  2. 58 is the only even choice, so its smallest prime factor is 2 — smaller than any odd number could manage. Answer 58.
2023 · #4 (figure problem)
amc8-2023-04
Show answer
Answer: D — Three of them are prime.
Show hints
Hint 1 of 2
Forget the spiral pattern — what matters is which numbers end up on those four squares.
Still stuck? Show hint 2 →
Hint 2 of 2
Find the four shaded numbers first (they sit on the diagonal through 7), then test each one for being prime.
Show solution
Approach: fill in the diagonal, then test each for primeness
  1. Continuing the spiral outward, the diagonal through 7 (going up-left and down-right) contains the four shaded numbers 19, 23, 39, 47.
  2. Test each: 19 prime, 23 prime, 47 prime; but 39 = 3 × 13 is composite.
  3. So 3 of the four shaded numbers are prime.
Another way — use perfect squares as landmarks (MAA):
  1. Without filling the whole grid: on an n×n spiral the number n2 sits in the upper-left (n even) or lower-right (n odd) corner. So 9 is at lower-right of the 3×3 block, 25 at lower-right of 5×5, 49 at lower-right of 7×7; 16 at upper-left of 4×4, 36 at upper-left of 6×6.
  2. Walking outward from those anchors locates the four shaded squares as 19, 23, 39, 47 — with 39 = 3 × 13 the only composite.
2007 · #3 What is the sum of the two smallest prime factors of 250?

What is the sum of the two smallest prime factors of 250?

Show answer
Answer: C — 7.
Show hint
Hint 1
250 = 2 · 53.
Show solution
Approach: factor 250
  1. 250 = 2 · 53. Two smallest (and only) primes: 2 and 5.
  2. Sum: 2 + 5 = 7.
2014 · #13 If n and m are integers and n2 + m2 is even, which of the following is impossible?

If n and m are integers and n2 + m2 is even, which of the following is impossible?

Show answer
Answer: D — n + m cannot be odd.
Show hint
Hint 1
Squares preserve parity: k2 is even iff k is even. So n2 + m2 even ⇒ n, m have the same parity.
Show solution
Approach: parity of squares matches parity of base
  1. n2 + m2 even ⇒ n2 and m2 have the same parity ⇒ n and m have the same parity.
  2. Same parity ⇒ n + m is always even, never odd.
2017 · #7 Let Z be a 6-digit positive integer, such as 247247, whose first three digits are the same as its last three digits taken in the same...

Let Z be a 6-digit positive integer, such as 247247, whose first three digits are the same as its last three digits taken in the same order. Which of the following numbers must also be a factor of Z?

Show answer
Answer: A — 11.
Show hint
Hint 1
Write Z = abcabc as a multiple of abc. The multiplier factors into nice primes.
Show solution
Approach: abcabc = 1001 · abc
  1. Z = abcabc = abc · 1001.
  2. 1001 = 7 · 11 · 13. So 11 is always a factor of Z.
2010 · #14 What is the sum of the prime factors of 2010?

What is the sum of the prime factors of 2010?

Show answer
Answer: C — 77.
Show hint
Hint 1
Factor out small primes first: 2010 / 2 / 3 / 5 = ?
Show solution
Approach: factor primes step by step
  1. 2010 = 2 · 1005 = 2 · 3 · 335 = 2 · 3 · 5 · 67 (67 is prime).
  2. Sum: 2 + 3 + 5 + 67 = 77.
CHAPTER 3

Prime factorization — every integer's fingerprint

THEORY

Every whole number ≥ 2 can be written as a product of primes in exactly one way (the order doesn't matter). This is called the Fundamental Theorem of Arithmetic, and it's the most important fact in number theory.

Example: 60 = 2 × 2 × 3 × 5 = 2² × 3 × 5. This is the only way to break 60 into primes.

How to find the prime factorization (the "factor tree"): divide by the smallest prime that fits, write the factor, repeat with the quotient. Stop when you reach 1.

842422213784 = 2 × 2 × 3 × 7 = 2² × 3 × 7

Read the leaves of the tree (the red primes at the bottom): 2, 2, 3, 7. So 84 = 2² × 3 × 7. You can also build a different-looking tree (split 84 as 4×21 first), but you'll always get the same primes at the leaves. That's the uniqueness theorem.

Why is this important? Because once you have the factorization, almost everything about the number becomes easy:

  • Is it a perfect square? Yes if every prime's exponent is even. (36 = 2²·3² → yes.)
  • How many divisors does it have? See chapter 4.
  • Is it divisible by some target? Check if all the target's primes are in the fingerprint.
  • What's the GCD or LCM with another number? See chapter 5.
THE TRICK

For small numbers, start with the smallest prime (2) and divide repeatedly until it doesn't fit anymore, then move to 3, then 5, then 7. Write each step.

Walkthrough — factor 360:

  1. 360 ÷ 2 = 180
  2. 180 ÷ 2 = 90
  3. 90 ÷ 2 = 45 (now 45 is odd; 2 doesn't fit anymore)
  4. 45 ÷ 3 = 15
  5. 15 ÷ 3 = 5
  6. 5 is prime — stop.

So 360 = 2³ × 3² × 5.

WORKED EXAMPLE
PROBLEM · 2016 #9

What is the sum of the distinct prime integer divisors of 2016?

A) 9 B) 12 C) 16 D) 49 E) 63

We want the sum of the distinct prime divisors of 2016. "Distinct" means "different primes that show up" — each prime counts once even if it appears with a higher exponent.

Factor 2016. Start with 2:

  • 2016 ÷ 2 = 1008
  • 1008 ÷ 2 = 504
  • 504 ÷ 2 = 252
  • 252 ÷ 2 = 126
  • 126 ÷ 2 = 63 (now 63 is odd)
  • 63 ÷ 3 = 21
  • 21 ÷ 3 = 7
  • 7 is prime.

So 2016 = 2⁵ × 3² × 7. The distinct primes are 2, 3, and 7. Their sum: 2 + 3 + 7 = 12.

Don't multiply the exponents in. "Distinct" means "how many different primes appear." 2 shows up 5 times in the factorization but it's still just one prime.

Answer: B — 12.
RULE OF THUMB

To factor: divide by the smallest prime that fits, repeat. Stop when you reach 1. The factorization is unique — write it as a product of prime powers.

MORE LIKE THIS
2018 · #18 How many positive factors does 23,232 have?

How many positive factors does 23,232 have?

Show answer
Answer: E — 42 factors.
Show hints
Hint 1 of 2
Find the prime factorization of 23,232, then multiply (exponent + 1) for each prime.
Still stuck? Show hint 2 →
Hint 2 of 2
23,232 = 26 · 3 · 112.
Show solution
Approach: prime factorize, multiply (exponent + 1) per prime
  1. Factor: 23,232 = 2 · 11,616 = 22 · 5,808 = … = 26 · 363 = 26 · 3 · 121 = 26 · 3 · 112.
  2. Number of factors: (6+1)(1+1)(2+1) = 7 · 2 · 3 = 42.
2017 · #19 For any positive integer M, the notation M! denotes the product of the integers 1 through M. What is the largest integer n for which 5n...

For any positive integer M, the notation M! denotes the product of the integers 1 through M. What is the largest integer n for which 5n is a factor of the sum

98! + 99! + 100! ?
Show answer
Answer: D — 26.
Show hints
Hint 1 of 2
Factor out 98! from all three terms. The leftover is a clean number.
Still stuck? Show hint 2 →
Hint 2 of 2
98! + 99! + 100! = 98!(1 + 99 + 99·100) = 98! · 10,000. Count factors of 5 in each piece.
Show solution
Approach: factor out 98!, count 5s
  1. 98! + 99! + 100! = 98!(1 + 99 + 99·100) = 98!(100 + 9900) = 98! · 10,000.
  2. 10,000 = 104 = 24 · 54 → contributes 4 factors of 5.
  3. Factors of 5 in 98!: ⌊98/5⌋ + ⌊98/25⌋ = 19 + 3 = 22.
  4. Total: 22 + 4 = 26.
2020 · #12 For a positive integer n, the factorial notation n! represents the product of the integers from n to 1. For example: 6! = 6 × 5 × 4 × 3...

For a positive integer n, the factorial notation n! represents the product of the integers from n to 1. For example: 6! = 6 × 5 × 4 × 3 × 2 × 1. What value of N satisfies the following equation?

5! × 9! = 12 × N!
Show answer
Answer: A — N = 10.
Show hints
Hint 1 of 2
Compute 5! — can you factor 12 out of it neatly?
Still stuck? Show hint 2 →
Hint 2 of 2
5! = 120 = 12 × 10. So the equation becomes 12 × 10 × 9! = 12 × N!.
Show solution
Approach: factor 12 out of 5!
  1. 5! = 120 = 12 × 10.
  2. So 5! × 9! = 12 × 10 × 9! = 12 × (10 × 9!) = 12 × 10!.
  3. Therefore N! = 10!, so N = 10.
2003 · #19 How many integers between 1000 and 2000 have all three of the numbers 15, 20, and 25 as factors?

How many integers between 1000 and 2000 have all three of the numbers 15, 20, and 25 as factors?

Show answer
Answer: C — 3 integers.
Show hints
Hint 1 of 2
A number divisible by all three is divisible by their least common multiple.
Still stuck? Show hint 2 →
Hint 2 of 2
LCM(15, 20, 25) = 300 — now count its multiples in range.
Show solution
Approach: reduce to multiples of the LCM
  1. Being divisible by 15, 20, and 25 is the same as being divisible by their LCM.
  2. LCM(15, 20, 25) = 300.
  3. Multiples of 300 between 1000 and 2000: 1200, 1500, 1800 — that's 3.
2016 · #7 Which of the following numbers is not a perfect square?

Which of the following numbers is not a perfect square?

Show answer
Answer: B — 2^2017.
Show hint
Hint 1
Any prime raised to an EVEN power is a perfect square. Any perfect square (like 4) raised to any power is also a perfect square.
Show solution
Approach: even exponent OR squared base = perfect square
  1. 12016 = 1 (trivially a square).
  2. 32018 and 52020: even exponents on a prime → perfect squares.
  3. 42019 = (22)2019 = 24038: even exponent overall → perfect square.
  4. 22017: prime with odd exponent → NOT a perfect square.
2018 · #14 Let N be the greatest five-digit number whose digits have a product of 120. What is the sum of the digits of N?

Let N be the greatest five-digit number whose digits have a product of 120. What is the sum of the digits of N?

Show answer
Answer: D — 18.
Show hints
Hint 1 of 2
Greedy: maximize the leftmost digit first — biggest single digit dividing 120.
Still stuck? Show hint 2 →
Hint 2 of 2
120 = 8 × 15. 15 = 5 × 3. 3 = 3 × 1. Remaining slots: 1, 1. Number: 85311.
Show solution
Approach: greedy left-to-right factorization
  1. Largest digit dividing 120 is 8 (since 9 doesn't divide 120). After taking out 8: leftover product 15.
  2. Largest digit dividing 15 is 5. Leftover: 3. Largest digit dividing 3 is 3. Leftover: 1 → fill remaining digits with 1.
  3. N = 85311. Digit sum: 8 + 5 + 3 + 1 + 1 = 18.
★ MINI-QUIZ

Divisibility, primes, factorization

Three problems that fall to the divisibility rules and the factor tree.

2002 · #5 Carlos Montado was born on Saturday, November 9, 2002. On what day of the week will Carlos be 706 days old?

Carlos Montado was born on Saturday, November 9, 2002. On what day of the week will Carlos be 706 days old?

Show answer
Answer: C — Friday.
Show hints
Hint 1 of 2
The day of the week repeats every 7 days, so only the remainder of 706 when divided by 7 matters.
Still stuck? Show hint 2 →
Hint 2 of 2
706 = 700 + 6, and 700 is a multiple of 7.
Show solution
Approach: strip off the whole weeks (multiples of 7)
  1. Since 700 is a multiple of 7, after 700 days the weekday is again Saturday.
  2. Six more days past Saturday lands on Friday.
2010 · #14 What is the sum of the prime factors of 2010?

What is the sum of the prime factors of 2010?

Show answer
Answer: C — 77.
Show hint
Hint 1
Factor out small primes first: 2010 / 2 / 3 / 5 = ?
Show solution
Approach: factor primes step by step
  1. 2010 = 2 · 1005 = 2 · 3 · 335 = 2 · 3 · 5 · 67 (67 is prime).
  2. Sum: 2 + 3 + 5 + 67 = 77.
2018 · #18 How many positive factors does 23,232 have?

How many positive factors does 23,232 have?

Show answer
Answer: E — 42 factors.
Show hints
Hint 1 of 2
Find the prime factorization of 23,232, then multiply (exponent + 1) for each prime.
Still stuck? Show hint 2 →
Hint 2 of 2
23,232 = 26 · 3 · 112.
Show solution
Approach: prime factorize, multiply (exponent + 1) per prime
  1. Factor: 23,232 = 2 · 11,616 = 22 · 5,808 = … = 26 · 363 = 26 · 3 · 121 = 26 · 3 · 112.
  2. Number of factors: (6+1)(1+1)(2+1) = 7 · 2 · 3 = 42.
CHAPTER 4

Counting divisors — exponent + 1, multiplied

THEORY

Once you have the prime factorization, counting divisors is a one-line formula.

DIVISOR COUNT FORMULA

If n = pa · qb · rc · … (its prime factorization),

then the number of positive divisors of n is

(a+1)(b+1)(c+1) · …

Where does the +1 come from? Every divisor is built by choosing how many copies of each prime to include. For a prime pa, the exponent in the divisor can be 0, 1, 2, …, a — that's a+1 choices. Multiply across all primes.

Example with 36. 36 = 2² · 3². For a divisor of 36, the exponent of 2 can be 0, 1, or 2 (three choices). The exponent of 3 can also be 0, 1, or 2 (three choices). Total divisors = 3 × 3 = 9.

Let's list them in a 3×3 grid to check:

exponent of 2 →2⁰·3⁰ = 12¹·3⁰ = 22²·3⁰ = 42⁰·3¹ = 32¹·3¹ = 62²·3¹ = 122⁰·3² = 92¹·3² = 182²·3² = 36exp of 3 →

3 rows × 3 columns = 9 divisors. Matches the (2+1)(2+1) formula.

Another example. How many divisors does 360 have? From chapter 3, 360 = 2³ × 3² × 5. So divisor count = (3+1)(2+1)(1+1) = 4 × 3 × 2 = 24 divisors.

Two patterns to spot in the divisor list

Pattern 1 — divisors come in pairs. Every divisor d of n has a partner n / d, which is also a divisor. The pair multiplies to n.

Try it. The divisors of 12 are 1, 2, 3, 4, 6, 12. Pair them up:

12346121×12 = 2×6 = 3×4 = 12

So the 6 divisors of 12 form 3 pairs. This is true in general: if n is NOT a perfect square, divisors pair up cleanly (count is always even). If n IS a perfect square, the divisor √n pairs with itself — so the count is odd. (Example: 36 has 9 divisors. The middle one is 6 = √36.)

A number is a perfect square ↔ it has an ODD number of divisors.

Pattern 2 — counting perfect-square divisors. A divisor of n is itself a perfect square exactly when each prime’s exponent (in the divisor) is even.

Example. How many perfect-square divisors does 360 = 2³ · 3² · 5 have? For each prime, count even-exponent choices:

  • Exponent of 2 in the divisor: even choices are {0, 2}. 2 options.
  • Exponent of 3: even choices are {0, 2}. 2 options.
  • Exponent of 5: even choice is {0}. 1 option.

Total: 2 · 2 · 1 = 4 perfect-square divisors (they are 1, 4, 9, 36).

THE TRICK

Perfect-square question? A number is a perfect square exactly when every prime in its factorization has an even exponent. So to make a number into a perfect square, multiply it by whatever's needed to bring all exponents up to even.

Example. What's the smallest positive integer we can multiply 72 by to get a perfect square? Factor: 72 = 2³ × 3². The exponent of 2 is 3 (odd), the exponent of 3 is 2 (even). To make 2's exponent even, multiply by one more 2. So multiply by 2: 72 × 2 = 144 = 12² ✓.

WORKED EXAMPLE
PROBLEM · 2018 #18

How many positive factors does 23,232 have?

A) 9 B) 12 C) 28 D) 36 E) 42

Factor 23,232. Divide by 2:

  • 23232 ÷ 2 = 11616
  • 11616 ÷ 2 = 5808
  • 5808 ÷ 2 = 2904
  • 2904 ÷ 2 = 1452
  • 1452 ÷ 2 = 726
  • 726 ÷ 2 = 363 (now 363 is odd, so 2 is done)
  • 363 ÷ 3 = 121
  • 121 = 11 × 11.

So 23,232 = 2⁶ · 3 · 11².

Apply the divisor count formula: (6+1)(1+1)(2+1) = 7 × 2 × 3 = 42 positive divisors.

Spend the time on the factorization — that's the hard part. Once you have it, the (a+1)(b+1)… formula is automatic. The exponent of 3 is 1, so you write (1+1) — easy to forget that primes with exponent 1 still contribute.

Answer: E — 42 factors.
RULE OF THUMB

Factor first. Then multiply (exponent + 1) for each prime. Don't forget primes with exponent 1 — they contribute a factor of 2.

MORE LIKE THIS
2016 · #9 What is the sum of the distinct prime integer divisors of 2016?

What is the sum of the distinct prime integer divisors of 2016?

Show answer
Answer: B — 12.
Show hint
Hint 1
Factor 2016 into primes.
Show solution
Approach: prime-factorize and add
  1. 2016 = 25 · 32 · 7.
  2. Distinct primes: 2, 3, 7. Sum = 2 + 3 + 7 = 12.
2017 · #7 Let Z be a 6-digit positive integer, such as 247247, whose first three digits are the same as its last three digits taken in the same...

Let Z be a 6-digit positive integer, such as 247247, whose first three digits are the same as its last three digits taken in the same order. Which of the following numbers must also be a factor of Z?

Show answer
Answer: A — 11.
Show hint
Hint 1
Write Z = abcabc as a multiple of abc. The multiplier factors into nice primes.
Show solution
Approach: abcabc = 1001 · abc
  1. Z = abcabc = abc · 1001.
  2. 1001 = 7 · 11 · 13. So 11 is always a factor of Z.
2017 · #19 For any positive integer M, the notation M! denotes the product of the integers 1 through M. What is the largest integer n for which 5n...

For any positive integer M, the notation M! denotes the product of the integers 1 through M. What is the largest integer n for which 5n is a factor of the sum

98! + 99! + 100! ?
Show answer
Answer: D — 26.
Show hints
Hint 1 of 2
Factor out 98! from all three terms. The leftover is a clean number.
Still stuck? Show hint 2 →
Hint 2 of 2
98! + 99! + 100! = 98!(1 + 99 + 99·100) = 98! · 10,000. Count factors of 5 in each piece.
Show solution
Approach: factor out 98!, count 5s
  1. 98! + 99! + 100! = 98!(1 + 99 + 99·100) = 98!(100 + 9900) = 98! · 10,000.
  2. 10,000 = 104 = 24 · 54 → contributes 4 factors of 5.
  3. Factors of 5 in 98!: ⌊98/5⌋ + ⌊98/25⌋ = 19 + 3 = 22.
  4. Total: 22 + 4 = 26.
2020 · #17 How many factors of 2020 have more than 3 factors? (As an example, 12 has 6 factors, namely 1, 2, 3, 4, 6, and 12.)

How many factors of 2020 have more than 3 factors? (As an example, 12 has 6 factors, namely 1, 2, 3, 4, 6, and 12.)

Show answer
Answer: B — 7 factors.
Show hints
Hint 1 of 2
Factor 2020 = 22 × 5 × 101. It has (2+1)(1+1)(1+1) = 12 factors total.
Still stuck? Show hint 2 →
Hint 2 of 2
Subtract those with at most 3 factors: 1 (one factor), primes 2/5/101 (two each), and squares of primes — here only 4 (three factors).
Show solution
Approach: subtract the easy-to-count low-factor cases
  1. 2020 = 22 · 5 · 101 has (2+1)(1+1)(1+1) = 12 factors.
  2. Factors with ≤ 3 factors: 1 (1 factor); 2, 5, 101 (2 factors each — primes); 4 (3 factors — prime squared). That's 5 of the 12.
  3. Remaining: 12 − 5 = 7 factors with more than 3 factors.
1988 · #14 ◇ and △ are whole numbers and ◇ × △ = 36. The largest possible value of ◇ + △ is

◇ and △ are whole numbers and ◇ × △ = 36. The largest possible value of ◇ + △ is

Show answer
Answer: E — 37.
Show hints
Hint 1 of 2
List all factor pairs of 36 and add each pair.
Still stuck? Show hint 2 →
Hint 2 of 2
Sums are biggest when the factors are most spread out.
Show solution
Approach: list factor pairs
  1. Factor pairs of 36: (1,36), (2,18), (3,12), (4,9), (6,6). Their sums: 37, 20, 15, 13, 12.
  2. The largest is 1 + 36 = 37.
2018 · #14 Let N be the greatest five-digit number whose digits have a product of 120. What is the sum of the digits of N?

Let N be the greatest five-digit number whose digits have a product of 120. What is the sum of the digits of N?

Show answer
Answer: D — 18.
Show hints
Hint 1 of 2
Greedy: maximize the leftmost digit first — biggest single digit dividing 120.
Still stuck? Show hint 2 →
Hint 2 of 2
120 = 8 × 15. 15 = 5 × 3. 3 = 3 × 1. Remaining slots: 1, 1. Number: 85311.
Show solution
Approach: greedy left-to-right factorization
  1. Largest digit dividing 120 is 8 (since 9 doesn't divide 120). After taking out 8: leftover product 15.
  2. Largest digit dividing 15 is 5. Leftover: 3. Largest digit dividing 3 is 3. Leftover: 1 → fill remaining digits with 1.
  3. N = 85311. Digit sum: 8 + 5 + 3 + 1 + 1 = 18.
CHAPTER 5

GCD and LCM — where things line up

THEORY

Two more questions you can answer instantly from prime factorizations.

  • The GCD (greatest common divisor) of two numbers is the biggest number that divides BOTH. GCD(12, 18) = 6.
  • The LCM (least common multiple) of two numbers is the smallest number that’s a multiple of BOTH. LCM(12, 18) = 36.

Recipe (just two rules)

Write each number’s prime factorization. For each prime, look at the two exponents:

Which?Take which exponent?For 12 = 2² · 3 & 18 = 2 · 3²
GCDSMALLER of the two2min(2,1) · 3min(1,2) = 21 · 31 = 6
LCMLARGER of the two2max(2,1) · 3max(1,2) = 22 · 32 = 36

The Venn picture — one diagram, two answers

Put 12’s primes in the left circle (2, 2, 3). Put 18’s primes in the right circle (2, 3, 3). The shared primes go in the MIDDLE.

GCD — only the MIDDLE counts232312 only18 onlycircle A = 12circle B = 18middle = 2 × 3 = 6GCD = 6LCM — the WHOLE union232312 only18 onlycircle A = 12circle B = 18everything = 2 × 2 × 3 × 3 = 36LCM = 36

Same two circles, two different questions. GCD is the shared overlap; LCM is everything together.

Quick check: GCD × LCM = 6 × 36 = 216. And 12 × 18 = 216. They match!

BEAUTIFUL IDENTITY (two numbers only)

GCD(a, b) × LCM(a, b) = a × b

Know one, get the other for free. Warning: this only works for TWO numbers; for three or more, it fails.

Where LCM matters most: when two cycles need to line up again. Bells at 4 and 6 minutes both ring together every LCM(4, 6) = 12 minutes. Lights flashing every 8 and 10 seconds sync every LCM(8, 10) = 40 seconds.

The Euclidean algorithm — GCD without factoring

What if the two numbers are HUGE and you don’t want to factor them? There’s a 2300-year-old shortcut (Euclid wrote it down). Replace the bigger number with its remainder when divided by the smaller. Repeat until one number is zero. The other is the GCD.

EUCLIDEAN ALGORITHM

gcd(a, b) = gcd(b, a mod b)

Keep replacing the bigger number with the leftover, until you hit 0.

Try it. What’s gcd(252, 105)?

  • 252 ÷ 105 = 2 remainder 42. Now gcd(105, 42).
  • 105 ÷ 42 = 2 remainder 21. Now gcd(42, 21).
  • 42 ÷ 21 = 2 remainder 0. Stop.

The last non-zero number is 21. So gcd(252, 105) = 21. (Check: 252 = 21 · 12, 105 = 21 · 5 ✓.)

This is much faster than factoring 252 and 105 when the numbers get big. AMC 8 mostly uses small numbers where factoring is fine, but the algorithm is good to have in your back pocket.

THE TRICK

If the question asks "when do two cycles meet again?" the answer is always LCM. If the question asks "what's the largest piece that fits both?" the answer is always GCD.

Memorize these mappings. Half the GCD/LCM problems on AMC 8 are just one of these patterns dressed up in a story.

WORKED EXAMPLE
PROBLEM · 1989 #22

The letters A, J, H, S, M, E and the digits 1, 9, 8, 9 are "cycled" separately as follows and put together in a numbered list:

      AJHSME  1989
  1.  JHSMEA  9891
  2.  HSMEAJ  8919
  3.  SMEAJH  9198
      .........

What is the number of the line on which AJHSME 1989 will appear for the first time?

A) 6 B) 10 C) 12 D) 18 E) 24

The 6 letters "AJHSME" come back to their original order every 6 cycles (one full cycle = 6 steps). The 4 digits "1989" come back every 4 cycles.

To make the combined string "AJHSME 1989" reappear, both cycles must finish at the same time. That happens at the smallest number that's a multiple of both 6 and 4 — that's the LCM.

LCM(6, 4) = 12.

So the original string first reappears at line 12.

This is just "two cycles must finish together." Don't try to write out the lines — recognize the pattern and apply LCM.

Answer: C — 12.
RULE OF THUMB

GCD ↔ "shared / inside," use smaller exponents. LCM ↔ "alignment / outside," use larger exponents. For cycle-meeting problems, it's always LCM.

MORE LIKE THIS
2004 · #19 A whole number larger than 2 leaves a remainder of 2 when divided by each of the numbers 3, 4, 5, and 6. The smallest such number lies...

A whole number larger than 2 leaves a remainder of 2 when divided by each of the numbers 3, 4, 5, and 6. The smallest such number lies between which two numbers?

Show answer
Answer: B — Between 60 and 79.
Show hint
Hint 1
x − 2 is divisible by lcm(3, 4, 5, 6) = 60.
Show solution
Approach: shift by 2 and use LCM
  1. Smallest x > 2 with x − 2 = 60 ⇒ x = 62.
  2. 62 lies between 60 and 79.
2009 · #11 The Amaco Middle School bookstore sells pencils costing a whole number of cents. Some seventh graders each bought a pencil, paying a...

The Amaco Middle School bookstore sells pencils costing a whole number of cents. Some seventh graders each bought a pencil, paying a total of $1.43. Some of the 30 sixth graders each bought a pencil, and they paid a total of $1.95. How many more sixth graders than seventh graders bought a pencil?

Show answer
Answer: D — 4 more.
Show hint
Hint 1
Working in cents, the price divides both 143 and 195. Compute gcd(143, 195).
Show solution
Approach: find the common price via gcd
  1. 143 = 11 · 13; 195 = 3 · 5 · 13. So price | 13 and price > 1 ⇒ price = 13¢.
  2. Seventh graders: 143/13 = 11. Sixth graders: 195/13 = 15.
  3. Difference: 15 − 11 = 4.
2012 · #13 Jamar bought some pencils costing more than a penny each at the school bookstore and paid $1.43. Sharona bought some of the same pencils...

Jamar bought some pencils costing more than a penny each at the school bookstore and paid $1.43. Sharona bought some of the same pencils and paid $1.87. How many more pencils did Sharona buy than Jamar?

Show answer
Answer: C — 4 more pencils.
Show hint
Hint 1
Working in cents: the price (in cents) divides both 143 and 187. Take their gcd; since price > 1 cent, only one option survives.
Show solution
Approach: gcd of the two amounts
  1. gcd(143, 187) = 11 (since 143 = 11 · 13, 187 = 11 · 17). Price > 1 cent ⇒ price = 11 cents.
  2. Difference Sharona − Jamar = (187 − 143) / 11 = 44 / 11 = 4.
2012 · #15 The smallest number greater than 2 that leaves a remainder of 2 when divided by 3, 4, 5, or 6 lies between what numbers?

The smallest number greater than 2 that leaves a remainder of 2 when divided by 3, 4, 5, or 6 lies between what numbers?

Show answer
Answer: D — Between 61 and 65.
Show hint
Hint 1
If x ≡ 2 (mod each of 3, 4, 5, 6), then x − 2 is a multiple of all of them, so a multiple of lcm(3, 4, 5, 6) = 60.
Show solution
Approach: shift to a multiple-of-LCM problem
  1. x − 2 divisible by 3, 4, 5, 6 ⇒ divisible by lcm = 60.
  2. Smallest such x > 2 is x = 60 + 2 = 62, which lies between 61 and 65.
2015 · #22 On June 1, a group of students is standing in rows, with 15 students in each row. On June 2, the same group is standing with all of the...

On June 1, a group of students is standing in rows, with 15 students in each row. On June 2, the same group is standing with all of the students in one long row. On June 3, the same group is standing with just one student in each row. On June 4, the same group is standing with 6 students in each row. This process continues through June 12 with a different number of students per row each day. However, on June 13, they cannot find a new way of organizing the students. What is the smallest possible number of students in the group?

Show answer
Answer: C — 60 students.
Show hints
Hint 1 of 2
Each day's row count is a divisor of n, all different. Twelve days ⇒ n has at least 12 divisors.
Still stuck? Show hint 2 →
Hint 2 of 2
n is divisible by both 15 and 6, so by lcm(6, 15) = 30. Smallest multiple of 30 with exactly 12 divisors?
Show solution
Approach: translate to a divisor-counting problem
  1. Each day's number of students per row is a divisor of n, and all 12 are different ⇒ n has exactly 12 divisors (no 13th option exists).
  2. n is a multiple of 15 and 6, hence of lcm(6, 15) = 30 = 2 · 3 · 5. That has only (1+1)(1+1)(1+1) = 8 divisors.
  3. Double one prime exponent to get 12: 22 · 3 · 5 = 60 has (2+1)(1+1)(1+1) = 12 divisors. The other options (32·2·5 = 90, 2·3·52=150) are larger.
  4. Smallest n = 60.
CHAPTER 6

Digit sums — the divisibility-by-9 fingerprint

THEORY

The digit sum of a number is what you get when you add its digits.

  • Digit sum of 1234 = 1+2+3+4 = 10.
  • Digit sum of 999 = 9+9+9 = 27.
  • Digit sum of 50 = 5+0 = 5.

Already we used this in chapter 1: for divisibility by 3 or 9, the digit sum tells you the answer. But there's a deeper fact:

DIGIT SUM ≡ NUMBER (mod 9)

The remainder of any number when divided by 9 is the same as the remainder of its digit sum when divided by 9.

This is why the divisibility rule for 9 works. And it gives a quick trick called casting out nines: if you keep adding the digits of the digit sum, you eventually get a single digit — that's the original number's remainder mod 9 (or 9 itself if the original was a multiple of 9). Adults used this for centuries before calculators to check their arithmetic.

Example. What's 1234 mod 9? Digit sum: 1+2+3+4 = 10. Digit sum again: 1+0 = 1. So 1234 ≡ 1 (mod 9). Check: 1234 = 137·9 + 1 ✓.

Casting out nines for an arithmetic check. If 472 + 351 = 823, the digit sums should match too: 4+7+2 = 13 → 4; 3+5+1 = 9 → 9 (which is 0 mod 9); 4 + 0 = 4. And 8+2+3 = 13 → 4. Both sides give 4 ✓. (If they hadn't matched, you'd know you had an arithmetic mistake.)

THE TRICK

When a problem asks for a missing digit to make a number divisible by 9 (or 3), use digit sums directly.

Example: "What digit ? makes 724? divisible by 9?" Digit sum = 7+2+4+? = 13 + ?. We need 13 + ? to be a multiple of 9. The closest multiple of 9 ≥ 13 is 18. So ? = 5. (The next, 27, would need ? = 14 — not a digit.) Check: 7245 = 9 × 805 ✓.

WORKED EXAMPLE
PROBLEM · 2018 #7

The 5-digit number 2018U is divisible by 9. What is the remainder when this number is divided by 8?

A) 1 B) 3 C) 5 D) 6 E) 7

The 5-digit number is 2018U and it's divisible by 9.

By the digit-sum rule for 9: 2 + 0 + 1 + 8 + U = 11 + U must be a multiple of 9.

11 + U ∈ {9, 18, 27, …}. Since U is a digit (0–9), 11 + U is between 11 and 20. So 11 + U = 18 → U = 7.

The number is 20187.

Now find the remainder when 20187 is divided by 8. By the rule for 8, look only at the last three digits: 187.

187 ÷ 8 = 23 remainder 3 (since 23 × 8 = 184, and 187 − 184 = 3).

So 20187 mod 8 = 3.

Two divisibility rules used back-to-back: digit sum for 9 to identify U, then last-three-digits for 8 to find the remainder. This kind of problem rewards knowing the rules cold.

Answer: B — Remainder 3.
RULE OF THUMB

For divisibility by 9 (or 3), use digit sums. The remainder mod 9 equals the digit sum's remainder mod 9. Repeated digit-summing gives the digital root.

MORE LIKE THIS
2024 · #4 When Yunji added all the integers from 1 to 9, she mistakenly left out a number. Her incorrect sum turned out to be a square number....

When Yunji added all the integers from 1 to 9, she mistakenly left out a number. Her incorrect sum turned out to be a square number. What number did Yunji leave out?

Show answer
Answer: E — She left out 9.
Show hints
Hint 1 of 2
Start from the correct total 1+2+…+9. Taking one number out lands you near a special number — which one?
Still stuck? Show hint 2 →
Hint 2 of 2
Find the correct total of 1 through 9. Leaving out x makes the sum 45 − x. Which x makes that a perfect square?
Show solution
  1. 1 + 2 + 3 + … + 9 = 45.
  2. Leaving out x (from 1 to 9) gives 45 − x, which is between 36 and 44.
  3. The only perfect square in that range is 36 = 62.
  4. 45 − x = 36, so x = 9.
2006 · #11 How many two-digit numbers have digits whose sum is a perfect square?

How many two-digit numbers have digits whose sum is a perfect square?

Show answer
Answer: C — 17.
Show hints
Hint 1 of 2
Digit sums of two-digit numbers range 1–18. Perfect squares in range: 1, 4, 9, 16.
Still stuck? Show hint 2 →
Hint 2 of 2
Count two-digit numbers with each of these digit sums.
Show solution
Approach: case on perfect-square digit sum
  1. Sum = 1: {10} ⇒ 1.
  2. Sum = 4: {13, 22, 31, 40} ⇒ 4.
  3. Sum = 9: {18, 27, 36, 45, 54, 63, 72, 81, 90} ⇒ 9.
  4. Sum = 16: {79, 88, 97} ⇒ 3.
  5. Total: 1 + 4 + 9 + 3 = 17.
1997 · #5 There are many two-digit multiples of 7, but only two of them have a digit sum of 10. The sum of these two multiples of 7 is

There are many two-digit multiples of 7, but only two of them have a digit sum of 10. The sum of these two multiples of 7 is

Show answer
Answer: A — 119.
Show hints
Hint 1 of 2
List the two-digit multiples of 7 and check each digit sum.
Still stuck? Show hint 2 →
Hint 2 of 2
Find the two whose digits add to 10.
Show solution
Approach: scan multiples of 7 for digit sum 10
  1. Among 14, 21, 28, …, 98, the ones with digit sum 10 are 28 and 91.
  2. Their sum is 28 + 91 = 119.
2018 · #14 Let N be the greatest five-digit number whose digits have a product of 120. What is the sum of the digits of N?

Let N be the greatest five-digit number whose digits have a product of 120. What is the sum of the digits of N?

Show answer
Answer: D — 18.
Show hints
Hint 1 of 2
Greedy: maximize the leftmost digit first — biggest single digit dividing 120.
Still stuck? Show hint 2 →
Hint 2 of 2
120 = 8 × 15. 15 = 5 × 3. 3 = 3 × 1. Remaining slots: 1, 1. Number: 85311.
Show solution
Approach: greedy left-to-right factorization
  1. Largest digit dividing 120 is 8 (since 9 doesn't divide 120). After taking out 8: leftover product 15.
  2. Largest digit dividing 15 is 5. Leftover: 3. Largest digit dividing 3 is 3. Leftover: 1 → fill remaining digits with 1.
  3. N = 85311. Digit sum: 8 + 5 + 3 + 1 + 1 = 18.
2019 · #13 A palindrome is a number that has the same value when read from left to right or from right to left. (For example, 12321 is a...

A palindrome is a number that has the same value when read from left to right or from right to left. (For example, 12321 is a palindrome.) Let N be the least three-digit integer which is not a palindrome but which is the sum of three distinct two-digit palindromes. What is the sum of the digits of N?

Show answer
Answer: A — 2.
Show hints
Hint 1 of 2
Two-digit palindromes (11, 22, 33, …) are all multiples of 11 — so any sum of three of them is a multiple of 11.
Still stuck? Show hint 2 →
Hint 2 of 2
Find the smallest 3-digit multiple of 11 that isn't itself a palindrome. Can it be written as a sum of three distinct 2-digit palindromes?
Show solution
Approach: two-digit palindromes are multiples of 11
  1. Two-digit palindromes (11, 22, …, 99) are all multiples of 11; their sum is too. So N is a multiple of 11.
  2. Smallest 3-digit multiple of 11 that's NOT a palindrome: 110 (palindromes are 121, 131, … — 110 isn't one).
  3. Check: 110 = 11 + 22 + 77 ✓ (three distinct 2-digit palindromes).
  4. N = 110; digit sum = 1 + 1 + 0 = 2.
2020 · #19 A number is called flippy if its digits alternate between two distinct digits. For example, 2020 and 37373 are flippy, but 3883 and...

A number is called flippy if its digits alternate between two distinct digits. For example, 2020 and 37373 are flippy, but 3883 and 123123 are not. How many five-digit flippy numbers are divisible by 15?

Show answer
Answer: B — 4 numbers.
Show hints
Hint 1 of 2
Divisible by 15 = divisible by 5 AND by 3. The last digit must be 0 or 5; since the number is 5 digits, the first digit can't be 0.
Still stuck? Show hint 2 →
Hint 2 of 2
Five-digit flippy: pattern ababa. a ≠ 0 and ends in a, so a = 5. Digit sum = 15 + 2bb ∈ {0, 3, 6, 9}.
Show solution
Approach: decompose div-by-15 into 5 and 3
  1. 5-digit flippy: ababa with ab and a ≠ 0.
  2. Div by 5 ⇒ last digit (= a) is 0 or 5. Since a ≠ 0, a = 5.
  3. Number is 5b5b5. Div by 3 ⇒ digit sum 15 + 2b div by 3 ⇒ b div by 3, so b ∈ {0, 3, 6, 9} (and all are ≠ 5).
  4. 4 flippy numbers.
★ MINI-QUIZ

Divisors, GCD/LCM, digit sums

Three problems that need the divisor formula or a digit-sum check.

2016 · #9 What is the sum of the distinct prime integer divisors of 2016?

What is the sum of the distinct prime integer divisors of 2016?

Show answer
Answer: B — 12.
Show hint
Hint 1
Factor 2016 into primes.
Show solution
Approach: prime-factorize and add
  1. 2016 = 25 · 32 · 7.
  2. Distinct primes: 2, 3, 7. Sum = 2 + 3 + 7 = 12.
2012 · #15 The smallest number greater than 2 that leaves a remainder of 2 when divided by 3, 4, 5, or 6 lies between what numbers?

The smallest number greater than 2 that leaves a remainder of 2 when divided by 3, 4, 5, or 6 lies between what numbers?

Show answer
Answer: D — Between 61 and 65.
Show hint
Hint 1
If x ≡ 2 (mod each of 3, 4, 5, 6), then x − 2 is a multiple of all of them, so a multiple of lcm(3, 4, 5, 6) = 60.
Show solution
Approach: shift to a multiple-of-LCM problem
  1. x − 2 divisible by 3, 4, 5, 6 ⇒ divisible by lcm = 60.
  2. Smallest such x > 2 is x = 60 + 2 = 62, which lies between 61 and 65.
2018 · #7 The 5-digit number 2018U is divisible by 9. What is the remainder when this number is divided by 8?

The 5-digit number 2018U is divisible by 9. What is the remainder when this number is divided by 8?

Show answer
Answer: B — Remainder 3.
Show hints
Hint 1 of 2
Div by 9 ⇔ digit sum div by 9. Find U.
Still stuck? Show hint 2 →
Hint 2 of 2
U = 7 (since 2+0+1+8 = 11; 11+U div by 9 ⇒ U = 7). Then 20187 mod 8.
Show solution
Approach: use the divisibility-by-9 rule
  1. Sum of digits 2+0+1+8+U = 11 + U must be a multiple of 9 (with 0 ≤ U ≤ 9). So U = 7.
  2. 20187 ÷ 8 = 2523 remainder 3 (since 2523 × 8 = 20184). Remainder: 3.
CHAPTER 7

Units digit cycles — what big powers end in

THEORY

When you raise a number to higher and higher powers, the units digit (the last digit) follows a short repeating pattern.

For example, powers of 2:

2¹=22²=42³=82⁴=162⁵=322⁶=642⁷=1282486248cycle of 4: 2, 4, 8, 6

Only the last digit matters: 2, 4, 8, 6, 2, 4, 8, 6, … repeating forever in groups of 4. So we say "powers of 2 have units-digit period 4."

The other cycles you should know cold:

UNITS-DIGIT CYCLES

  • 2: 2, 4, 8, 6 (period 4)
  • 3: 3, 9, 7, 1 (period 4)
  • 4: 4, 6 (period 2)
  • 5: always 5
  • 6: always 6
  • 7: 7, 9, 3, 1 (period 4)
  • 8: 8, 4, 2, 6 (period 4)
  • 9: 9, 1 (period 2)
  • 0, 1, 5, 6: stuck (period 1 — they don't change)

How to find the units digit of an:

  1. Keep only the units digit of a.
  2. Look up its cycle (above).
  3. Find which spot in the cycle n lands on by computing n mod (cycle length).

Example. Units digit of 3⁷? Cycle of 3 has period 4. 7 mod 4 = 3. So we want the 3rd entry of the cycle 3, 9, 7, 1 — that's 7. (Check: 3⁷ = 2187 ✓.)

Example. Units digit of 7¹⁰⁰? Cycle of 7 has period 4. 100 mod 4 = 0, which means the last entry of the cycle (the 4th). Cycle of 7 is 7, 9, 3, 1. Last entry is 1.

THE TRICK

Be careful with the indexing. If n mod 4 = 0, that's the 4th spot in the cycle (the end), not the 0th. Many students get this off by one. The cleanest rule: if cycle length is 4, then n=1 uses the 1st entry, n=2 the 2nd, n=3 the 3rd, n=4 the 4th, n=5 the 1st again, etc.

WORKED EXAMPLE
PROBLEM · 2024 #1

What is the ones digit of

222,222 − 22,222 − 2,222 − 222 − 22 − 2 ?
A) 0 B) 2 C) 4 D) 6 E) 8

The expression is 222,222 − 22,222 − 2,222 − 222 − 22 − 2. Only the ones digit matters.

The five numbers being subtracted (22222, 2222, 222, 22, 2) all end in 2. So the sum of their ones digits is 5 × 2 = 10.

Subtracting a number that ends in 0 (a multiple of 10) from 222,222 doesn't change its ones digit. So the ones digit of the answer is the same as the ones digit of 222,222 — which is 2.

The trick: focus only on the ones-digit column. The total amount being subtracted (in the ones column) is 10, which carries over and leaves a 0. So the original 2 stays. Don't compute the full 5-digit subtractions.

Answer: B — The ones digit is 2.
RULE OF THUMB

For large powers, find the units-digit cycle and reduce the exponent mod the cycle length. Memorize the cycles for 2, 3, 7, 8 (period 4); 4 and 9 (period 2); 0, 1, 5, 6 (stuck).

MORE LIKE THIS
2000 · #14 What is the units digit of 1919 + 9999?

What is the units digit of 1919 + 9999?

Show answer
Answer: D — 8.
Show hints
Hint 1 of 2
Only the units digit of the base matters, and powers of 9 cycle 9, 1, 9, 1, …
Still stuck? Show hint 2 →
Hint 2 of 2
9 raised to an odd power ends in 9.
Show solution
Approach: track only the units digit
  1. Powers of 9 end in 9 for odd exponents and 1 for even ones. Both 19 and 99 end in 9, and both exponents are odd, so each power ends in 9.
  2. 9 + 9 = 18, so the units digit is 8.
2019 · #14 Isabella has 6 coupons that can be redeemed for free ice cream cones at Pete's Sweet Treats. In order to make the coupons last, she...

Isabella has 6 coupons that can be redeemed for free ice cream cones at Pete's Sweet Treats. In order to make the coupons last, she decides that she will redeem one every 10 days until she has used them all. She knows that Pete's is closed on Sundays, but as she circles the 6 dates on her calendar, she realizes that no circled date falls on a Sunday. On what day of the week does Isabella redeem her first coupon?

Show answer
Answer: C — Wednesday.
Show hints
Hint 1 of 2
10 days ≡ 3 days mod 7. So the 6 redemption days are at day-of-week offsets 0, 3, 6, 2, 5, 1 from the starting day.
Still stuck? Show hint 2 →
Hint 2 of 2
Those 6 offsets cover 6 of 7 days — missing only offset 4. Sunday must be that missing day, so the start = Sunday − 4 days = Wednesday.
Show solution
Approach: compute the 6 days mod 7, find the missing one
  1. 10 days advances the day-of-week by 10 mod 7 = 3 days. So the six redemption days have day-of-week offsets {0, 3, 6, 2, 5, 1} mod 7 from the start.
  2. These 6 offsets cover everything except offset 4. Sunday must be that missing offset, so start day is Sunday − 4 days.
  3. Counting back from Sunday: Sat, Fri, Thu, Wed.
2022 · #17 If n is an even positive integer, the double-factorial notation n!! represents the product of all the even integers from 2 to n. For...

If n is an even positive integer, the double-factorial notation n!! represents the product of all the even integers from 2 to n. For example: 8!! = 2 × 4 × 6 × 8. What is the units digit of the following sum?

2!! + 4!! + 6!! + … + 2022!!
Show answer
Answer: B — Units digit 2.
Show hints
Hint 1 of 2
Once a double-factorial includes 10 as a factor, it ends in 0. Which terms in the sum still affect the ones digit?
Still stuck? Show hint 2 →
Hint 2 of 2
Only 2!!, 4!!, 6!!, 8!! contribute — everything from 10!! onward ends in 0.
Show solution
Approach: drop the 10!!-and-up terms (they end in 0)
  1. n!! for n ≥ 10 contains the factor 10, so its units digit is 0.
  2. Compute only the survivors: 2!! = 2, 4!! = 8, 6!! = 48, 8!! = 384. Their units digits: 2, 8, 8, 4.
  3. Sum of units digits: 2 + 8 + 8 + 4 = 22. Units digit: 2.
2025 · #6 Sekou writes down the numbers 15, 16, 17, 18, 19. After he erases one of his numbers, the sum of the remaining four numbers is a...

Sekou writes down the numbers 15, 16, 17, 18, 19. After he erases one of his numbers, the sum of the remaining four numbers is a multiple of 4. Which number did he erase?

Show answer
Answer: C — 17.
Show hints
Hint 1 of 2
Adding the five up and testing each removal is slow. What does each number have in common with 4?
Still stuck? Show hint 2 →
Hint 2 of 2
Look at each number's remainder when divided by 4. The remainder of the whole sum tells you which one to erase.
Show solution
Approach: look at remainders mod 4
  1. Remainders mod 4: 15→3, 16→0, 17→1, 18→2, 19→3. Their sum is 9, which leaves remainder 1 mod 4.
  2. To make the remaining four sum divisible by 4, erase the one whose remainder is 1 — that's 17.
1997 · #25 All the even numbers from 2 to 98 inclusive, except those ending in 0, are multiplied together. What is the units digit of the product?

All the even numbers from 2 to 98 inclusive, except those ending in 0, are multiplied together. What is the units digit of the product?

Show answer
Answer: D — 6.
Show hints
Hint 1 of 2
Only units digits matter; each block of ten contributes the units 2, 4, 6, 8.
Still stuck? Show hint 2 →
Hint 2 of 2
2 × 4 × 6 × 8 ends in 4, and there are ten blocks — find the units digit of 4¹⁰.
Show solution
Approach: group by tens, then find the units of a power
  1. Each block of ten (like 2, 4, 6, 8) multiplies to a units digit of 4, and there are 10 such blocks, so we need the units digit of 4¹⁰.
  2. 4² ends in 6, and any power of 6 ends in 6, so 4¹⁰ = (4²)⁵ ends in 6.
1996 · #15 The remainder when the product 1492 · 1776 · 1812 · 1996 is divided by 5 is

The remainder when the product 1492 · 1776 · 1812 · 1996 is divided by 5 is

Show answer
Answer: E — 4.
Show hints
Hint 1 of 2
Only the units digit of each factor matters for the remainder mod 5.
Still stuck? Show hint 2 →
Hint 2 of 2
Multiply the units digits and look at that product's units digit.
Show solution
Approach: work with units digits
  1. The units digits are 2, 6, 2, 6, and 2 · 6 · 2 · 6 = 144 ends in 4.
  2. A number ending in 4 leaves remainder 4 when divided by 5.
CHAPTER 8

Parity — the simplest mod, and the deepest

THEORY

Parity is just “is this number even or odd?” The simplest math fact in the universe — but on AMC, it’s a superpower.

What “even” vs “odd” really meansline up the dots in pairs. EVEN = all paired. ODD = 1 leftover.42 pairs — none leftoverEVEN5↑ leftoverODD63 pairs — none leftoverEVEN7↑ leftoverODDA number is EVEN if it splits into pairs.It’s ODD if one dot is always leftover.

The combination rules — just two tables

When you ADD or MULTIPLY two numbers, the result’s parity is determined by the parities of the pieces. Memorize:

+evenodd
evenevenodd
oddoddeven
×evenodd
eveneveneven
oddevenodd
Notice the × table: if EITHER factor is even, the product is even. The only way to get an odd product is odd × odd.

Where parity wins on AMC

  • “Is X even or odd?” Track parity through the operations — you don’t need the actual value.
  • “Odd number = sum of two primes”: one prime MUST be 2 (the only even prime).
  • Counting moves on a grid. Each step flips parity. A square at distance 5 requires 5, 7, 9, … moves — never an even count.
  • “Sum of n consecutive integers is even/odd?” Just count how many odd terms are in the list.
THE TRICK

Whenever a problem asks "is X even or odd?" or "find an arrangement where the sum is even," parity is your first move. The result's parity is determined by the structure (how many odds you add, how many evens you multiply), not by the actual values.

Tiny example. Is 3 × 5 × 7 × 9 × 11 even or odd? All five factors are odd. odd × odd = odd, so multiplying any number of odd numbers gives odd. Answer: odd. (No need to compute — 3·5·7·9·11 = 10395, ends in 5, an odd number.)

WORKED EXAMPLE
PROBLEM · 2002 #2

How many different combinations of $5 bills and $2 bills can be used to make a total of $17? Order does not matter.

A) 2 B) 3 C) 4 D) 5 E) 6

How many ways can you make exactly $17 from $5 bills and $2 bills? Let f = number of $5 bills, t = number of $2 bills, so 5f + 2t = 17.

Parity move. 2t is even regardless of t. 17 is odd. So 5f must be odd — which forces f itself to be odd (because 5×even = even, 5×odd = odd).

So f ∈ {1, 3, 5, …}. Try each:

  • f = 1: 5 + 2t = 17 → t = 6 ✓
  • f = 3: 15 + 2t = 17 → t = 1 ✓
  • f = 5: 25 > 17 — too big.

Exactly 2 combinations.

Parity isn't just for prime problems. Whenever you have a linear equation like 5f + 2t = 17 and one coefficient is even, the parity of the other side tells you the parity of the remaining variable — instantly halving the search.

Answer: A — 2.
RULE OF THUMB

For "odd vs. even" questions, track parity through the operations. For "sum of two primes" problems where the sum is odd, one prime is forced to be 2.

MORE LIKE THIS
2014 · #4 The sum of two prime numbers is 85. What is the product of these two prime numbers?

The sum of two prime numbers is 85. What is the product of these two prime numbers?

Show answer
Answer: E — 166.
Show hint
Hint 1
Odd sum from two primes ⇒ one of them must be even. The only even prime is 2.
Show solution
Approach: the only even prime is 2
  1. 85 is odd, so one prime is even ⇒ it must be 2.
  2. The other prime: 85 − 2 = 83 (prime).
  3. Product: 2 × 83 = 166.
2024 · #5 Aaliyah rolls two standard 6-sided dice. She notices that the product of the two numbers rolled is a multiple of 6. Which of the...

Aaliyah rolls two standard 6-sided dice. She notices that the product of the two numbers rolled is a multiple of 6. Which of the following integers cannot be the sum of the two numbers?

Show answer
Answer: B — The sum cannot be 6.
Show hints
Hint 1 of 2
The product is a multiple of 6 only when the two dice meet a special condition. Test each answer choice against it.
Still stuck? Show hint 2 →
Hint 2 of 2
A product is a multiple of 6 only if the pair contains a 3 or 6 (factor of 3) and an even number (factor of 2). Just test the answer choices against that.
Show solution
  1. The pair must include a multiple of 3 (a 3 or a 6) and an even number.
  2. Sum 6 comes only from (1,5), (2,4), (3,3) — products 5, 8, 9, none a multiple of 6. So 6 is impossible.
  3. Every other choice has a good pair: 5 = (2,3)→6, 7 = (1,6)→6, 8 = (2,6)→12, 9 = (3,6)→18.
Another way — list every valid pair (MAA):
  1. Pairs whose product is a multiple of 6 (need a multiple of 3 and an even number): (1,6), (2,3), (2,6), (3,6), (4,6), (5,6), (6,6).
  2. Their sums: 7, 5, 8, 9, 10, 11, 12. Among A–E, only 6 is missing.
2014 · #13 If n and m are integers and n2 + m2 is even, which of the following is impossible?

If n and m are integers and n2 + m2 is even, which of the following is impossible?

Show answer
Answer: D — n + m cannot be odd.
Show hint
Hint 1
Squares preserve parity: k2 is even iff k is even. So n2 + m2 even ⇒ n, m have the same parity.
Show solution
Approach: parity of squares matches parity of base
  1. n2 + m2 even ⇒ n2 and m2 have the same parity ⇒ n and m have the same parity.
  2. Same parity ⇒ n + m is always even, never odd.
2007 · #3 What is the sum of the two smallest prime factors of 250?

What is the sum of the two smallest prime factors of 250?

Show answer
Answer: C — 7.
Show hint
Hint 1
250 = 2 · 53.
Show solution
Approach: factor 250
  1. 250 = 2 · 53. Two smallest (and only) primes: 2 and 5.
  2. Sum: 2 + 5 = 7.
CHAPTER 9

Modular arithmetic — clocks and remainders

THEORY

Modular arithmetic is the math of leftovers. Instead of asking “what’s the actual answer?” you ask “what’s left over after dividing?”

You already know it from clocks. If it’s 9:00 and you wait 5 hours, the clock reads 2:00, not 14:00. The hour hand doesn’t care that 9 + 5 = 14 — it only cares about the leftover after 12.

121234567891011start: 9:00hourminute+ 5 hr1212345678910115 hr later: 2:00hourminute

9 + 5 = 14, but the clock loops back at 12. So 14 mod 12 = 2. The clock IS modular arithmetic.

Days of the week work the same way, but with cycle 7. Today + 7 days = same day. Today + 30 days = same day shifted by 30 mod 7 = 2.

Reading the notation “a ≡ b (mod n)”

You see …Read it as …Why
14 ≡ 2 (mod 12)14 and 2 leave the same leftover when divided by 1214 = 1·12 + 2; 2 = 0·12 + 2 — both leftover 2
30 ≡ 2 (mod 7)30 days from now is 2 weekdays ahead30 = 4·7 + 2 — leftover 2
100 ≡ 0 (mod 5)100 leaves NO leftover when divided by 5100 = 20·5 + 0 — perfect multiple

The superpower: do arithmetic with leftovers

Once you switch into leftover-mode, you can replace huge numbers with tiny ones before adding or multiplying. The leftover of the final answer comes out the same.

What’s the leftover of 2024 + 2025 when divided by 7?The slow way: compute 2024 + 2025 = 4049, then 4049 ÷ 7 = 578 R 3.The mod way:2024 ≡ 1(2023 = 7·289)+2025 ≡ 2(2024 ≡ 1, +1)=1 + 2 ≡ 3(mod 7)Same answer. The leftover of 4049 ÷ 7 is 3, and we found it without ever adding the big numbers.
The Big Rule: you can replace any number with its leftover BEFORE doing arithmetic. The final leftover is the same.
THE TRICK

For "days of the week N days later" problems, reduce N mod 7. For "hours later on a 12-hour clock" problems, reduce mod 12. The pattern is the same: identify the cycle length, reduce, then read.

For arithmetic in modular form, replace each number with its remainder before adding or multiplying. This is the only way to handle huge numbers.

WORKED EXAMPLE
PROBLEM · 2025 #6

Sekou writes down the numbers 15, 16, 17, 18, 19. After he erases one of his numbers, the sum of the remaining four numbers is a multiple of 4. Which number did he erase?

A) 15 B) 16 C) 17 D) 18 E) 19

Sekou's five numbers: 15, 16, 17, 18, 19. Their remainders mod 4:

  • 15 ÷ 4 = 3 remainder 3
  • 16 ÷ 4 = 4 remainder 0
  • 17 ÷ 4 = 4 remainder 1
  • 18 ÷ 4 = 4 remainder 2
  • 19 ÷ 4 = 4 remainder 3

Total of remainders: 3 + 0 + 1 + 2 + 3 = 9. And 9 mod 4 = 1. So all five numbers together leave a remainder of 1 when divided by 4.

For the remaining four numbers (after erasing one) to sum to a multiple of 4, the erased number must equal the current total's remainder mod 4. The total is 1 mod 4. So we erase the number with remainder 1 mod 4 — that's 17.

You never had to actually add the five numbers (15+16+17+18+19 = 85, then check 85−x ≡ 0 mod 4). The mod-4 approach skips the addition. Track the remainders, find the one that needs to leave.

Answer: C — 17.
RULE OF THUMB

Any cycle problem reduces mod its cycle length. Days mod 7, hours mod 12, units digit mod 10. Replace big numbers with their remainders before doing arithmetic.

MORE LIKE THIS
2002 · #5 Carlos Montado was born on Saturday, November 9, 2002. On what day of the week will Carlos be 706 days old?

Carlos Montado was born on Saturday, November 9, 2002. On what day of the week will Carlos be 706 days old?

Show answer
Answer: C — Friday.
Show hints
Hint 1 of 2
The day of the week repeats every 7 days, so only the remainder of 706 when divided by 7 matters.
Still stuck? Show hint 2 →
Hint 2 of 2
706 = 700 + 6, and 700 is a multiple of 7.
Show solution
Approach: strip off the whole weeks (multiples of 7)
  1. Since 700 is a multiple of 7, after 700 days the weekday is again Saturday.
  2. Six more days past Saturday lands on Friday.
2016 · #5 The number N is a two-digit number.When N is divided by 9, the remainder is 1.When N is divided by 10, the remainder is 3.What is the...

The number N is a two-digit number.

  • When N is divided by 9, the remainder is 1.
  • When N is divided by 10, the remainder is 3.

What is the remainder when N is divided by 11?

Show answer
Answer: E — Remainder 7.
Show hints
Hint 1 of 2
Remainder 3 mod 10 means N ends in 3. So N ∈ {13, 23, 33, …, 93}.
Still stuck? Show hint 2 →
Hint 2 of 2
Which of those leaves remainder 1 when divided by 9? Sum of digits gives the answer fast (sum ≡ N mod 9).
Show solution
Approach: narrow to last-digit-3, then check mod 9
  1. Last digit 3, so N ∈ {13, 23, 33, 43, 53, 63, 73, 83, 93}.
  2. Sum-of-digits test for mod 9: only 73 has digit sum 10 ≡ 1 (mod 9). So N = 73.
  3. 73 mod 11: 11 × 6 = 66, remainder 7. Answer: 7.
2019 · #14 Isabella has 6 coupons that can be redeemed for free ice cream cones at Pete's Sweet Treats. In order to make the coupons last, she...

Isabella has 6 coupons that can be redeemed for free ice cream cones at Pete's Sweet Treats. In order to make the coupons last, she decides that she will redeem one every 10 days until she has used them all. She knows that Pete's is closed on Sundays, but as she circles the 6 dates on her calendar, she realizes that no circled date falls on a Sunday. On what day of the week does Isabella redeem her first coupon?

Show answer
Answer: C — Wednesday.
Show hints
Hint 1 of 2
10 days ≡ 3 days mod 7. So the 6 redemption days are at day-of-week offsets 0, 3, 6, 2, 5, 1 from the starting day.
Still stuck? Show hint 2 →
Hint 2 of 2
Those 6 offsets cover 6 of 7 days — missing only offset 4. Sunday must be that missing day, so the start = Sunday − 4 days = Wednesday.
Show solution
Approach: compute the 6 days mod 7, find the missing one
  1. 10 days advances the day-of-week by 10 mod 7 = 3 days. So the six redemption days have day-of-week offsets {0, 3, 6, 2, 5, 1} mod 7 from the start.
  2. These 6 offsets cover everything except offset 4. Sunday must be that missing offset, so start day is Sunday − 4 days.
  3. Counting back from Sunday: Sat, Fri, Thu, Wed.
2022 · #17 If n is an even positive integer, the double-factorial notation n!! represents the product of all the even integers from 2 to n. For...

If n is an even positive integer, the double-factorial notation n!! represents the product of all the even integers from 2 to n. For example: 8!! = 2 × 4 × 6 × 8. What is the units digit of the following sum?

2!! + 4!! + 6!! + … + 2022!!
Show answer
Answer: B — Units digit 2.
Show hints
Hint 1 of 2
Once a double-factorial includes 10 as a factor, it ends in 0. Which terms in the sum still affect the ones digit?
Still stuck? Show hint 2 →
Hint 2 of 2
Only 2!!, 4!!, 6!!, 8!! contribute — everything from 10!! onward ends in 0.
Show solution
Approach: drop the 10!!-and-up terms (they end in 0)
  1. n!! for n ≥ 10 contains the factor 10, so its units digit is 0.
  2. Compute only the survivors: 2!! = 2, 4!! = 8, 6!! = 48, 8!! = 384. Their units digits: 2, 8, 8, 4.
  3. Sum of units digits: 2 + 8 + 8 + 4 = 22. Units digit: 2.
1988 · #10 Chris's birthday is on a Thursday this year. What day of the week will it be 60 days after her birthday?

Chris's birthday is on a Thursday this year. What day of the week will it be 60 days after her birthday?

Show answer
Answer: A — Monday.
Show hints
Hint 1 of 2
Days of the week repeat every 7 days, so reduce 60 modulo 7.
Still stuck? Show hint 2 →
Hint 2 of 2
60 = 8·7 + 4.
Show solution
Approach: reduce mod 7
  1. 60 days = 8 full weeks plus 4 extra days.
  2. 4 days after Thursday → Friday, Saturday, Sunday, Monday.
1985 · #20 In a certain year, January had exactly four Tuesdays and four Saturdays. On what day did January 1 fall that year?

In a certain year, January had exactly four Tuesdays and four Saturdays. On what day did January 1 fall that year?

Show answer
Answer: C — Wednesday.
Show hints
Hint 1 of 2
31 days = 4 weeks + 3 days. Three weekdays appear 5 times, the other four appear 4 times.
Still stuck? Show hint 2 →
Hint 2 of 2
For Tuesday and Saturday both to land at 4 times, neither can be among the first 3 days of the month.
Show solution
Approach: find which start makes Tue and Sat both rare
  1. The three weekdays starting on Jan 1 each appear 5 times in a 31-day January. For Tue and Sat both to appear only 4 times, neither can be in those first three weekdays.
  2. Only starting on Wednesday (Wed, Thu, Fri) leaves both Tue and Sat out of that group.
⬢ FINAL TEST

Stretch test

Five harder number-theory problems. Each one combines two or three of the habits above.

2017 · #12 The smallest positive integer greater than 1 that leaves a remainder of 1 when divided by 4, 5, and 6 lies between which of the...

The smallest positive integer greater than 1 that leaves a remainder of 1 when divided by 4, 5, and 6 lies between which of the following pairs of numbers?

Show answer
Answer: D — Between 60 and 79.
Show hint
Hint 1
Same remainder mod 4, 5, AND 6 means n − 1 is divisible by all three. So n − 1 = lcm(4, 5, 6).
Show solution
Approach: lcm shift
  1. n − 1 is divisible by 4, 5, and 6, so by lcm(4, 5, 6) = 60.
  2. Smallest n > 1: n = 61, which lies between 60 and 79.
2018 · #25 How many perfect cubes lie between 28 + 1 and 218 + 1, inclusive?

How many perfect cubes lie between 28 + 1 and 218 + 1, inclusive?

Show answer
Answer: E — 58 cubes.
Show hints
Hint 1 of 2
218 = (26)3 = 643. So cubes ≤ 218 + 1 means base ≤ 64.
Still stuck? Show hint 2 →
Hint 2 of 2
28 = 256, 28 + 1 = 257. The next cube above 257 is 73 = 343 (since 63 = 216).
Show solution
Approach: bracket the cube-root bounds
  1. Upper end: 218 = (26)3 = 643, so 643 ≤ 218 + 1 ✓. Cubes at base ≥ 65 exceed the range.
  2. Lower end: 63 = 216 < 257 = 28 + 1, but 73 = 343 ≥ 257 ✓. Smallest valid base: 7.
  3. Count integers from 7 to 64 inclusive: 64 − 7 + 1 = 58.
2025 · #23 How many four-digit numbers have all three of the following properties?The tens digit and ones digit are both 9.The number is 1 less...

How many four-digit numbers have all three of the following properties?

  1. The tens digit and ones digit are both 9.
  2. The number is 1 less than a perfect square.
  3. The number is the product of exactly two prime numbers.
Show answer
Answer: B — Exactly 1.
Show hints
Hint 1 of 2
The number ends in 99, so the perfect square just above it ends in 00. What does that say about its square root?
Still stuck? Show hint 2 →
Hint 2 of 2
Use a2 − 1 = (a − 1)(a + 1). For the number to be a product of exactly two primes, both factors must be prime — twin primes.
Show solution
Approach: a² ends in 00, then look for twin primes around a
  1. A 4-digit number ending in 99 plus 1 ends in 00. So that perfect square = (10k)2, and our number is (10k)2 − 1 = (10k − 1)(10k + 1).
  2. Four-digit range gives 10k ∈ {40, 50, 60, 70, 80, 90, 100}.
  3. We need both 10k − 1 and 10k + 1 prime. Check: 39×41 (39 = 3×13, no), 49×51 (49 = 72, no), 59×61 (both prime ✓), 69×71 (69 = 3×23, no), 79×81 (81 = 34, no), 89×91 (91 = 7×13, no), 99×101 (99 = 9×11, no).
  4. Only 59 × 61 = 3599 works. Exactly 1.
2018 · #13 Laila took five math tests, each worth a maximum of 100 points. Laila's score on each test was an integer between 0 and 100, inclusive....

Laila took five math tests, each worth a maximum of 100 points. Laila's score on each test was an integer between 0 and 100, inclusive. Laila received the same score on the first four tests, and she received a higher score on the last test. Her average score on the five tests was 82. How many values are possible for Laila's score on the last test?

Show answer
Answer: A — 4 values.
Show hints
Hint 1 of 2
Set 4f + l = 410, with f < l ≤ 100. Get bounds on l first.
Still stuck? Show hint 2 →
Hint 2 of 2
Since 4f is divisible by 4 and 410 ≡ 2 (mod 4), we need l ≡ 2 (mod 4).
Show solution
Approach: modular constraint + range
  1. Average 82 over 5 tests ⇒ total = 410. Let f = first-four score, l = last. Then 4f + l = 410 with f < l ≤ 100.
  2. l > 82 (else 4f + l would need fl).
  3. Mod 4: 4f ≡ 0, 410 ≡ 2 ⇒ l ≡ 2 (mod 4). In (82, 100]: l ∈ {86, 90, 94, 98}.
  4. 4 values.
1989 · #22 The letters A, J, H, S, M, E and the digits 1, 9, 8, 9 are "cycled" separately as follows and put together in a numbered list: AJHSME...

The letters A, J, H, S, M, E and the digits 1, 9, 8, 9 are "cycled" separately as follows and put together in a numbered list:

      AJHSME  1989
  1.  JHSMEA  9891
  2.  HSMEAJ  8919
  3.  SMEAJH  9198
      .........

What is the number of the line on which AJHSME 1989 will appear for the first time?

Show answer
Answer: C — 12.
Show hints
Hint 1 of 2
The letters return to AJHSME every 6 lines; the digits return to 1989 every 4 lines.
Still stuck? Show hint 2 →
Hint 2 of 2
The two parts line up again the first time both cycles finish together.
Show solution
Approach: LCM of the two cycle lengths
  1. The 6 letters come back after 6 cycles; the 4 digits come back after 4 cycles.
  2. Both line up together at the smallest common multiple: LCM(6, 4) = 12.
APPENDIX

Number theory quick-reference

Memorize these

FACTS TO KNOW COLD

  • Primes ≤ 50: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47.
  • The only even prime is 2. 1 is NOT prime.
  • To test if n is prime: trial-divide by primes ≤ √n. Beyond that, no factors can hide.
  • Divisibility by 3 or 9: digit sum.
  • Divisibility by 4: last 2 digits.
  • Divisibility by 8: last 3 digits.
  • Divisibility by 11: alternating digit sum.
  • Divisibility by 7: chop last digit, double it, subtract from what's left.
  • Divisibility by 13: chop last digit, multiply by 4, add to what's left.
  • 1001 = 7 · 11 · 13 — split into 3-digit groups, alternating sum tests all three at once.
  • Difference of squares: a² − b² = (a − b)(a + b).
  • Divisor count formula: for n = pa · qb · …, count = (a+1)(b+1)·…
  • Perfect-square ↔ odd number of divisors. Every other number has an even count.
  • Perfect-square divisors of n: count divisors using only EVEN exponents.
  • Divisors pair up: d ↔ n/d, product = n.
  • GCD(a, b) × LCM(a, b) = a × b (two positive integers — fails for three or more).
  • Euclidean algorithm: gcd(a, b) = gcd(b, a mod b). Replace the bigger with the leftover until you hit 0.
  • Units-digit cycles: 2/3/7/8 → period 4; 4/9 → period 2; 0/1/5/6 → stuck.
  • Digit sum ≡ N (mod 9).
Common traps
  • 1 is not prime. The smallest prime is 2.
  • Confusing "multiple of" with "divisor of". Multiples of 6: 6, 12, 18, 24, … Divisors of 6: 1, 2, 3, 6.
  • Mod-cycle off-by-one. If a cycle has period 4 starting at n=1, then n=4 hits the 4th entry (the last), n=5 wraps to the 1st.
  • Forgetting primes with exponent 1. 60 = 2²·3·5 has (2+1)(1+1)(1+1) = 12 divisors. The exponent-1 primes still contribute a (+1) factor.
  • Computing huge powers directly. Always reduce mod the relevant modulus first.
Warm-ups

Drill these until they're reflexive:

  • Factor in your head: 72 = 2³·3², 100 = 2²·5², 144 = 2⁴·3², 168 = 2³·3·7, 360 = 2³·3²·5.
  • Count divisors of 360 = 2³·3²·5. (Answer: 4·3·2 = 24)
  • What's the units digit of 7100? (Cycle period 4; 100 mod 4 = 0 → last in cycle = 1.)
  • What's 210 mod 7? (1024 = 146·7 + 2, so remainder 2.)
  • Smallest multiple of both 4 and 6? (LCM = 12.)
  • Largest divisor of both 18 and 24? (GCD = 6.)
  • Is 91 prime? (No: 91 = 7·13.)
  • Factor 1001. (1001 = 7·11·13 — memorize this!)
  • Is 154 divisible by 7? (15 − 2·4 = 7 ✓.)
  • Is 247 divisible by 13? (24 + 4·7 = 52 = 13·4 ✓.)
  • Is 854,854 divisible by 11? (Yes — repeating 3-block ABCABC means it's abc·1001, divisible by 7, 11, AND 13.)
Want to climb higher? — advanced number-theory tools (#22–#25 territory)
  • Perfect-square filter (mod 3, mod 4). A perfect square can ONLY have these remainders:
     · mod 3: 0 or 1 (never 2). So if N ≡ 2 (mod 3), N is NOT a perfect square.
     · mod 4: 0 or 1 (never 2 or 3). So if N ≡ 2 or 3 (mod 4), N is NOT a perfect square.
    Great for “is X a perfect square?” questions — rules out most numbers in one glance.
  • Sum of divisors of n = pa · qb: σ(n) = (1 + p + p² + … + pa) · (1 + q + q² + … + qb). So σ(112) = σ(2⁴ · 7) = (1+2+4+8+16) · (1+7) = 31 · 8 = 248.
  • Product of divisors of n: nd/2 where d is the number of divisors. (Pair each divisor with its partner; the product of every pair is n.)
  • Chicken McNugget Theorem. If a and b are coprime positive integers, the largest amount you CANNOT make as a non-negative combination of a’s and b’s is ab − a − b. (For 4 and 7: the largest unmakeable amount is 4·7 − 4 − 7 = 17.)
  • Legendre’s formula (exponent of prime p in n!): vp(n!) = ⌊n/p⌋ + ⌊n/p²⌋ + ⌊n/p³⌋ + … — useful for “how many trailing zeros does 100! have?” (answer: v5(100!) = 20 + 4 = 24).