πŸ‡ΊπŸ‡Έ AMC 8 ⇄ switch contest
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 test day.

A good chunk of every contest is number theory: 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

Quick: is 3,471 a multiple of 3? You did not reach for long division — you can't, in your head, that fast. But there IS a way to know in two seconds. Add the digits: 3+4+7+1 = 15. That's a multiple of 3, so 3,471 is too. No dividing.

That's the whole game of this chapter. Divisible means “splits evenly, no leftover.” 12 is divisible by 3 because 12 ÷ 3 = 4 exactly; 13 is not, because 13 ÷ 3 leaves 1 over. You COULD test by dividing — but for every common divisor (2, 3, 4, 5, 6, 8, 9, 10, 11) there's a shortcut rule that reads the answer straight off the digits. Learn these cold. They show up on almost every contest.

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 contest 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”: 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 contest problems.

Why does the rule work? Watch the pattern.

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

9 × 1 = 9β†’99 × 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 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 only 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.

Why the LAST-DIGITS rules work — the big part falls away

The ÷4 rule (look at the last two digits) and the ÷8 rule (last three) feel arbitrary. They're not. The reason is one tiny fact: 4 divides 100, and 8 divides 1000.

Take any number and chop it at the hundreds: 7,328 is 73×100 + 28. The chunk 73×100 is built entirely out of 100s — and every 100 is 4×25, so that whole chunk is already a stack of 4s. It can't tip the answer. Only the leftover 28 decides it.

Is 7328 divisible by 4?73 × 100a stack of 100s = a stack of 4s+ 28the only part that mattersalready a multiple of 4 — ignore it28 = 4×7 ✓So 7328 is divisible by 4. Only the last two digits ever decide it.

Same story for 8: every 1000 is 8×125, so the thousands-and-up chunk is a stack of 8s and falls away — only the last three digits get a vote. That's the whole reason the rule stops where it does.

The ÷4 rule reads two digits because 4 divides 100. The ÷8 rule reads three because 8 divides 1000. Everything above is already a clean stack.

Why the ÷3 and ÷9 rule works — every 10 is “one extra”

You saw the pattern for 9 above. Here's the engine behind it in one line: 10 leaves a leftover of 1 when you divide by 9 (10 = 9 + 1). So does 100 (= 99 + 1), and 1000, and every power of 10.

So when you build 471 as 4×100 + 7×10 + 1, each hundred contributes “1 leftover,” each ten contributes “1 leftover,” and the ones contribute themselves. Sweep up all the leftovers and you get exactly 4 + 7 + 1 — the digit sum. The digit sum IS the leftover (mod 9). Since 3 also divides 9-and-friends the same way, the rule works for 3 too.

Why the ÷11 rule alternates + − + −

Multiply any four-digit number ABCD by 11 and watch the digits. Each digit lands in TWO neighboring columns at once (because 11 = 10 + 1), so the columns become:

ABCD × 11 spreads each digit into two columnsAA+BB+CC+DD+++A − (A+B) + (B+C) − (C+D) + D = 0 — everything cancels.

Add them with alternating signs and every letter cancels: A − (A+B) + (B+C) − (C+D) + D = 0. That cancellation is exactly why the alternating digit sum of any multiple of 11 comes out to 0 (or a multiple of 11). The deeper reason: powers of 10 bounce +1, −1, +1, −1 mod 11 (since 10 = 11 − 1), which is where the alternating signs are born.

The one engine behind EVERY rule — multiples add and subtract

Every rule above is really the same trick wearing different costumes. Here is the engine they all run on:

THE MULTIPLE ENGINE

  • If two numbers are BOTH multiples of c, then their sum and their difference are multiples of c too.
  • If you add a multiple of c to a number that is NOT a multiple of c, the result is never a multiple of c.

Picture three baskets, each holding exactly 7 eggs. Pour two together: 14 eggs, still a clean stack of 7s. Pour one out: 7 eggs, still clean. You can never get a leftover by combining whole baskets — a leftover can only come from a basket that wasn’t full to begin with.

That is exactly why we keep saying “the big chunk falls away.” Take 7328 tested for 4: we wrote it as 7300 + 28. The 7300 is a stack of 4s (a multiple), so by the engine it can’t change the answer — only the leftover 28 votes. And if 28 had NOT been a multiple of 4, adding the clean 7300 could never rescue it. The digit-sum rule, the last-digits rule, the alternating-sum rule — each one peels off a big multiple-of-c chunk and leaves a tiny leftover that decides everything.

Multiple ± multiple = multiple. Multiple ± non-multiple = non-multiple. Every divisibility test is just “peel off the multiple, judge the leftover.”

Testing a COMPOSITE — split it, but only the RIGHT way

There’s no special digit rule for 36. So how do you test it fast? Break 36 into a product and test each piece. We already do this for 6 (“divisible by 2 AND 3”). The catch most people miss: it only works when the two pieces share no common factor.

The good split. 36 = 4 × 9, and 4 and 9 share nothing (their GCD is 1 — they’re relatively prime). So a number is divisible by 36 exactly when it passes the rule for 4 AND the rule for 9, separately.

  • Is 612 divisible by 36? By 4: last two digits 12 = 4×3 ✓. By 9: digit sum 6+1+2 = 9 ✓. Both pass ⇒ yes. (Check: 612 = 36×17.)
Bogus split

“36 = 3 × 12, so test divisible-by-3 and divisible-by-12.” Try 24: it’s divisible by 3 (digit sum 6) and by 12 (24 = 12×2) — yet 24 is NOT a multiple of 36.

Why it breaks: 3 and 12 share a factor of 3, so “passes 3 and passes 12” only guarantees divisibility by lcm(3,12) = 12, not 36. The overlap gets counted once instead of twice. The fix: split into pieces with no shared factor (relatively prime), and their product gives the real test. 4 × 9 works because lcm(4,9) = 36; 3 × 12 fails because lcm(3,12) = 12.

To test a composite, split it into RELATIVELY PRIME pieces (GCD 1) and test each. 36 = 4×9 ✓, not 3×12. Check the split with lcm: it must equal the original.
🎯 Try it
Use the 4-and-9 split to confirm 612 is divisible by 36, then finish: 612 ÷ 36 = ?
Walkthrough: 4 and 9 are relatively prime and 4×9 = 36, so the split is legal. By 4: last two digits 12 = 4×3 ✓. By 9: 6+1+2 = 9 ✓. Both pass, so 612 is a multiple of 36, and 612 ÷ 36 = 17.

WORKED EXAMPLE — amc8-2024-05

Aaliyah rolls two dice and the PRODUCT is a multiple of 6. Which listed sum (5, 6, 7, 8, 9) can the two numbers NOT add to?

Use the split: 6 = 2 × 3 with 2 and 3 relatively prime. So the product is a multiple of 6 exactly when, between the two dice, there’s at least one even face AND at least one multiple of 3 (a 3 or a 6).

Now check each target sum — can a pair hitting that sum supply both a factor of 2 and a factor of 3? Sum 6 splits only as 1+5, 2+4, 3+3 (products 5, 8, 9): none has BOTH an even face and a 3-or-6. Every other listed sum has a working pair — 5 = 2+3, 7 = 1+6, 8 = 2+6, 9 = 3+6. So the impossible one is sum 6.

Framing inspired by AoPS Prealgebra.

Pictured-intuition adapted from Competition Math for Middle School (AoPS).

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 · 2014 #8

Eleven members of the Middle School Math Club each paid the same integer amount for a guest speaker to talk about problem solving at their math club meeting. In all, they paid their guest speaker $1A2. What is the missing digit A of this 3-digit number?

A) 0 B) 1 C) 2 D) 3 E) 4

Eleven club members each pay the SAME whole-dollar amount, and the total comes to $1A2 (a three-digit number with a missing middle digit). Find A.

Here's the move that turns a money sentence into a number-theory fact: “11 equal shares” means the total is a multiple of 11. So 1A2 must be divisible by 11.

Use the rule for 11 — alternating sum of the digits: 1 − A + 2 = 3 − A, and that must be a multiple of 11 (including 0).

A is a single digit, so 3 − A sits between 3 − 9 = −6 and 3 − 0 = 3. The only multiple of 11 in that window is 0. So 3 − A = 0, giving A = 3.

Check: 132 = 11 × 12 ✓. The missing digit is 3.

The unlock isn't the divisibility rule — it's the translation. “n people pay the same whole amount” always means “the total is divisible by n.” Once you write that, the alternating-sum rule for 11 finishes it in one line.

Answer: D β€” A = 3.
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
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 3
The cheapest clue to use is the ÷10 one: a leftover of 3 when you divide by 10 simply means N ends in the digit 3. That single fact shrinks the whole list to {13, 23, 33, …, 93}.
Still stuck? Show hint 2 →
Hint 2 of 3
Now apply the ÷9 clue. Handy shortcut: a number's leftover when divided by 9 equals the leftover of its DIGIT SUM — so just look for the candidate whose digits add to something 1-more-than-a-multiple-of-9.
Still stuck? Show hint 3 →
Hint 3 of 3
Find N first; only THEN divide it by 11. Don't try to juggle all three divisors at once — pin down the number, then answer the actual question.
Show solution
Approach: let the easy clue filter the list, then test with the digit-sum trick
  1. "Leftover 3 when divided by 10" means the units digit is 3, so N ∈ {13, 23, 33, 43, 53, 63, 73, 83, 93}.
  2. Digit-sum test for division by 9 (a number and its digit sum leave the same leftover): 13→4, 23→5, …, 73→10 which leaves 1. Only 73 leaves a leftover of 1. So N = 73.
  3. Now answer the real question: 73 = 11 × 6 + 7, so the leftover when divided by 11 is 7.
  4. Why this transfers: when several remainder conditions overlap, start with the one that fixes the most (divide-by-10 fixes a whole digit), then sieve the short list — far faster than algebra.
2016 Β· #9 Alex has one rope 1Β m long and another 2Β m long. He cuts up both ropes so that all the pieces are of equal length. Which of the...

Alex has one rope 1 m long and another 2 m long. He cuts up both ropes so that all the pieces are of equal length. Which of the following numbers of pieces can he not obtain this way?

Show answer
Answer: B — 8
Show hints
Hint 1 of 2
Every piece must fit a whole number of times into the 1 m rope and into the 2 m rope.
Still stuck? Show hint 2 →
Hint 2 of 2
If each piece is 1/n of a metre, the short rope gives n pieces and the long rope gives 2n, so the total is always a multiple of 3.
Show solution
Approach: the total number of pieces is always a multiple of 3
  1. Equal pieces must divide both ropes exactly, so each piece is 1/n of a metre for some whole number n.
  2. Then the 1 m rope makes n pieces and the 2 m rope makes 2n pieces, for 3n pieces in all — always a multiple of 3.
  3. Among the options 6, 9, 12 and 15 are multiples of 3, but 8 is not, so 8 pieces cannot be obtained.
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 hints
Hint 1 of 2
Every multiple of 13 is 13·k. Instead of hunting the multiples, hunt the multipliers k that keep 13k in the 100–999 range — they form a tidy run of consecutive whole numbers.
Still stuck? Show hint 2 →
Hint 2 of 2
Find the first k with 13k ≥ 100 and the last with 13k ≤ 999. Then count the integers between, inclusive.
Show solution
Approach: count the multipliers, not the multiples
  1. Write each multiple as 13k. Smallest 3-digit one: 100 ÷ 13 ≈ 7.7, so k = 8 gives 13·8 = 104. Largest: 999 ÷ 13 ≈ 76.8, so k = 76 gives 13·76 = 988.
  2. So k runs through 8, 9, …, 76 — a block of consecutive integers. Count them: 76 − 8 + 1 = 69.
  3. The two things people botch: remember the +1 (counting endpoints, not gaps — that's why it's 69, not 68), and translate the problem into counting k's rather than the multiples themselves. This 'count the index' trick works for any 'how many multiples in a range' question.
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
What does "multiple of 6" really demand of the two dice? Break 6 into its prime pieces — the product needs both of them.
Still stuck? Show hint 2 →
Hint 2 of 2
Technique: 6 = 2 × 3, so the pair needs a factor of 2 (an even die) AND a factor of 3 (a 3 or 6). Test each answer's possible pairs against that single rule.
Show solution
Approach: test which sum has no multiple-of-6 pair
  1. The insight: "multiple of 6" means "has a factor 2 AND a factor 3." So the pair must contain at least one even number AND at least one 3 or 6. That's the only condition — no need to multiply anything out.
  2. Now test each sum. Sum 6 can only be (1,5), (2,4), or (3,3). Check: (1,5) has no even-and-3, (2,4) has no 3 or 6, (3,3) has a 3 but no even number. None qualify — so a sum of 6 is impossible.
  3. Every other choice does have a qualifying pair: 5 = (2,3), 7 = (1,6), 8 = (2,6), 9 = (3,6). Answer: 6. This transfers: to test divisibility by a composite like 6, 12, or 15, split it into prime factors and check each one separately.
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.
2011 Β· #21 The five-digit number 24X8Y is divisible by 4, 5 and 9. What is the sum of X and Y?

The five-digit number 24X8Y is divisible by 4, 5 and 9. What is the sum of X and Y?

Show answer
Answer: E — 4
Show hints
Hint 1 of 2
Use the rule for 5 first, then narrow Y with the rule for 4.
Still stuck? Show hint 2 →
Hint 2 of 2
Finally make the digit sum a multiple of 9 to find X.
Show solution
Approach: apply the divisibility rules for 5, 4, then 9
  1. Divisible by 5 means Y is 0 or 5; divisible by 4 needs the last two digits 8Y divisible by 4, forcing Y = 0.
  2. Divisible by 9 means 2+4+X+8+0 = 14+X is a multiple of 9, so X = 4.
  3. Then X + Y = 4 + 0 = 4.
2016 Β· #24 The digits 1, 2, 3, 4, and 5 are each used once to write a five-digit number PQRST. The three-digit number PQR is divisible by 4, the...

The digits 1, 2, 3, 4, and 5 are each used once to write a five-digit number PQRST. The three-digit number PQR is divisible by 4, the three-digit number QRS is divisible by 5, and the three-digit number RST is divisible by 3. What is P?

Show answer
Answer: A — P = 1.
Show hints
Hint 1 of 3
Attack the TIGHTEST rule first. Divisible-by-5 is the strictest: the last digit must be 0 or 5, and the only one of {1,2,3,4,5} available is 5 — so QRS divisible by 5 instantly forces S = 5. One clue, one digit pinned.
Still stuck? Show hint 2 →
Hint 2 of 3
Next-tightest: PQR divisible by 4 means its last two digits QR form a multiple of 4. With 5 used up, QR is a two-digit number from {1, 2, 3, 4} that's a multiple of 4 — only 12, 24, 32 qualify. Just three cases left.
Still stuck? Show hint 3 →
Hint 3 of 3
Finish with the gentlest rule (divisible by 3 = digit sum divisible by 3) to test the survivors. Notice R is shared by all three numbers, so it's heavily constrained — track it.
Show solution
Approach: apply the divisibility rules from most-restrictive to least, then test the few survivors
  1. Divisible-by-5 is strictest: QRS ends in S, which must be 0 or 5, so S = 5.
  2. Divisible-by-4: QR (the last two digits of PQR) must be a multiple of 4 built from {1, 2, 3, 4} — only 12, 24, 32 work. Three cases.
  3. QR = 12: leftovers {3, 4} for P, T; RST = 25T has digit sum 7 + T, and T ∈ {3, 4} gives 10 or 11 — not divisible by 3. Out.
  4. QR = 24: leftovers {1, 3}; RST = 45T has digit sum 9 + T, and T = 3 gives 12, divisible by 3. ✓ That forces P = 1, so PQRST = 12435 and P = 1.
  5. QR = 32: leftovers {1, 4}; RST = 25T sum 7 + T with T ∈ {1, 4} gives 8 or 11 — not divisible by 3. Out. Only one solution survives.
  6. Why this transfers: for digit puzzles with several divisibility rules, always resolve the most restrictive constraint first (it pins digits outright), which shrinks the casework before the looser rules ever come up.
CHAPTER 2

Primes β€” the building blocks

THEORY

Take 12 marbles. You can lay them in a neat rectangle a few ways: 2 rows of 6, 3 rows of 4. Now try 7 marbles. One row of 7 — and that's it. No fatter rectangle works. Some numbers refuse to be split into a rectangle. Those are the special ones.

A prime number is a whole number bigger 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 splits. 6 = 2 × 3, so 6 is composite. 7 won’t split, so 7 is prime. Primes are the atoms of the number world: every other number is built by multiplying primes together.

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

How to FIND every prime — the Sieve of Eratosthenes

A Greek named Eratosthenes found a way to catch every prime under 100 with no dividing at all — only crossing out. The idea: primes are whatever is LEFT once you remove every multiple.

Write 1 to 100 in a grid. Then:

  1. Cross out 1 (not prime). Circle 2, then cross out every other multiple of 2 (4, 6, 8, …).
  2. Circle 3 (still standing), then cross out every multiple of 3 (6, 9, 12, …).
  3. Circle 5, cross out its multiples. Then 7, cross out its multiples.
  4. Stop. You only need to sieve by primes up to √100 = 10 — that's only 2, 3, 5, 7. Everything still uncrossed is prime.
Sieve of Eratosthenes — cross out every multiple; the survivors are PRIME123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100striker primes 2,3,5,7survives = PRIMEcrossed out = compositeStroke colors show the FIRST prime that struck each: red=2, teal=3, gold=5, purple=7.Cross out their multiples and 25 primes are left under 100.

Why stop at 7? Same reason as the prime-test below: any composite under 100 must have a factor at or below √100 = 10, so the strikers 2, 3, 5, 7 catch all of them. The 25 survivors are exactly the primes under 100.

Pictured-intuition adapted from Competition Math for Middle School (AoPS).

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 ✓
🎯 Try it
One of these is NOT prime: 83, 89, 91, 97. Which one? (Type it.)
Walkthrough: √91 ≈ 9.5, so test 2, 3, 5, 7. It's odd (not 2), digit sum 10 (not 3), doesn't end in 0 or 5. But 91 ÷ 7 = 13 — clean! So 91 = 7 × 13 is composite. 83, 89, 97 all survive every test, so they're prime. The trap: 91 LOOKS prime. It's the classic “fake prime.”
Watch out for the fake primes: 51 = 3×17, 57 = 3×19, 91 = 7×13, 119 = 7×17. They feel prime but aren't — always run the √n test.
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.

WATCH OUT
Bogus solution

Is 143 prime? It’s odd, so not divisible by 2. Its digits add to 8, so not divisible by 3. It doesn’t end in 0 or 5, so not divisible by 5. And 143 ÷ 7 isn’t whole. Tested 2, 3, 5, 7 — all fail — so 143 is PRIME.

Why it breaks: the √n test says go up to √143 ≈ 11.96, so you must also try 11 — and 143 = 11 × 13. Stopping at 7 quit one prime too soon.

The fix: test every prime whose square is ≤ n. Since 11² = 121 ≤ 143 but 13² = 169 > 143, the real stop is 11, not 7. Find √n first, then test every prime up to it — don’t stop early.

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
2020 Β· #1 Which of the following additions does not give a prime number?

Which of the following additions does not give a prime number?

Show answer
Answer: E — 5 + 7
Show hints
Hint 1 of 2
Work out each sum first, then ask which total has a factor other than 1 and itself.
Still stuck? Show hint 2 →
Hint 2 of 2
A number is prime only if nothing besides 1 and itself divides it — check the five totals.
Show solution
Approach: add each pair, then test the five sums for primality
  1. The sums are 13, 11, 17, 7 and 12.
  2. 13, 11, 17 and 7 are all prime (no smaller divisor works).
  3. 5 + 7 = 12 = 2 × 6, which is composite.
  4. So the sum that is not prime is choice E.
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 hints
Hint 1 of 2
Don't factor all five numbers — ask what the smallest possible prime factor even is, then look for it.
Still stuck? Show hint 2 →
Hint 2 of 2
The smallest prime is 2, and only even numbers own a factor of 2. Scan for the even one.
Show solution
Approach: chase the smallest prime (2) instead of factoring everything
  1. The winner needs the tiniest prime factor, and no prime beats 2. So the real question is: which choice is even? An even number automatically has 2 as its smallest prime factor.
  2. 58 is the only even number on the list, so its smallest prime factor is 2 — smaller than any odd number can manage. Answer 58.
  3. You'll see this again: 'smallest/largest prime factor' problems reward looking for the small primes (2, then 3, then 5) first rather than fully factoring every option.
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 hints
Hint 1 of 2
250 ends in 0, so it's even and a multiple of 5 — you already know its two smallest primes without dividing anything.
Still stuck? Show hint 2 →
Hint 2 of 2
The smallest prime factors hide in the last digit: even ⇒ 2 lives there; ending in 0 or 5 ⇒ 5 lives there.
Show solution
Approach: spot the primes from the last digit
  1. 250 ends in 0, which means it's divisible by both 2 and by 5 — the two smallest primes any number can have. So the two smallest are 2 and 5 with no work.
  2. Sum: 2 + 5 = 7.
  3. Why you can stop: 2 and 5 are the smallest two primes that exist, so once a number has both, nothing smaller can sneak in. (Fully, 250 = 2 · 53, but you never needed that.)
2023 Β· #4 (figure problem)
Figure for AMC 8 2023 Problem 4
Show answer
Answer: D — Three of them are prime.
Show hints
Hint 1 of 2
The spiral is just scenery — the real question is simply which four numbers land on those squares. Find them, then the problem becomes ‘how many are prime?’
Still stuck? Show hint 2 →
Hint 2 of 2
To find the numbers without drawing the whole grid, use the perfect squares as landmarks: 9, 25, 49 sit at corners of their layers. Then test each shaded number for primeness (a quick digit-sum check catches multiples of 3).
Show solution
Approach: fill in the diagonal, then test each for primeness
  1. The clever move is to ignore the picture's prettiness and just ask: which four numbers land on those squares? Once you know them, the spiral has done its job and the question is pure prime-testing.
  2. Continuing the spiral outward, the diagonal through 7 carries the four shaded numbers 19, 23, 39, 47.
  3. Now test each for primeness. 39 jumps out: its digits add to 12 (a multiple of 3), so 39 = 3 × 13 is composite. The other three — 19, 23, 47 — are prime.
  4. So 3 of the four shaded numbers are prime. Worth keeping: the digit-sum test (digits add to a multiple of 3 ⇒ divisible by 3) is the fastest way to spot a non-prime here.
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.
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 hints
Hint 1 of 2
2010 ends in 0, so it's begging to be split as 201 × 10. That instantly hands you the primes 2 and 5 — now just crack 201.
Still stuck? Show hint 2 →
Hint 2 of 2
To prime-factor, peel off the easy small primes first (2, 3, 5) using divisibility shortcuts, then factor whatever's left.
Show solution
Approach: peel off small primes using divisibility tests
  1. The trailing 0 gives 2010 = 201 × 10 = 2 · 5 · 201. For 201, its digits sum to 3, so 3 divides it: 201 = 3 · 67.
  2. 67 has no small factor (not even, not a multiple of 3 or 5, and 7·7 > 67 once you've ruled out 7) — so it's prime.
  3. Primes are 2, 3, 5, 67; sum = 77.
  4. Why this transfers: divisibility tests (even → 2, digit-sum → 3, ends in 0/5 → 5) let you factor by inspection. And you only test primes up to the square root before declaring what's left prime.
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
Translate each clue into a structural fact. Ending in 99 means "add 1" gives a number ending in 00 — and a perfect square ending in 00 forces its square root to be a multiple of 10. That alone cuts the candidates to a handful.
Still stuck? Show hint 2 →
Hint 2 of 2
Now the number is (10k)2 − 1 = (10k − 1)(10k + 1), already factored. "Product of exactly two primes" means both of those factors must themselves be prime — you're hunting twin primes straddling a multiple of 10.
Show solution
Approach: turn the clues into structure: square ends in 00, then seek twin primes
  1. Decode the conditions instead of testing thousands of numbers. "Ends in 99" + 1 = ends in 00, and a square ending in 00 must be (10k)2. So the number is (10k)2 − 1 = (10k − 1)(10k + 1) — a difference of squares, factored for free.
  2. Four-digit size forces 10k ∈ {40, 50, 60, 70, 80, 90, 100}, just 7 cases.
  3. "Product of exactly two primes" now means both 10k − 1 and 10k + 1 are 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 survives, so exactly 1.
  5. Why this transfers: "one less than a perfect square" should instantly trigger the difference-of-squares factoring a2 − 1 = (a−1)(a+1) — turning a vague property into a concrete factorization you can prime-test.
CHAPTER 3

Prime factorization β€” every integer's fingerprint

THEORY

Hand 60 to ten different people and ask them to break it into primes. Someone starts 60 = 6×10, someone else 60 = 4×15, someone else 60 = 2×30. Different first steps — but keep going, and EVERY one of them lands on the exact same pile of primes: 2, 2, 3, 5. Always. That's not a coincidence; it's a law.

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

So 60 = 2 × 2 × 3 × 5 = 2² × 3 × 5, and that's the ONLY prime recipe for 60. Think of it as the number's fingerprint: no two numbers share one.

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.
🎯 Try it
Write 360 as a product of primes: 360 = 2a × 3b × 5c. What is the sum of the exponents a + b + c?
Walkthrough: halve until odd: 360 → 180 → 90 → 45 — that's three 2s, so a = 3. Then 45 = 3² × 5, so b = 2 and c = 1. Thus 360 = 2³ × 3² × 5 and a + b + c = 3 + 2 + 1 = 6.
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.

Reading “is A a multiple of B?” straight off the fingerprints

Once you have both prime factorizations, you can answer “does B divide A?” without dividing. The rule is a quiet one but it’s everywhere: A is a multiple of B exactly when A’s fingerprint contains B’s — every prime in B, raised to at least as high a power.

Example. Is 1008 = 2⁴ · 3² · 7 a multiple of 72 = 2³ · 3²? Check each prime in 72: 2 appears to the 4th power in 1008 (need at least 3 — OK), 3 appears to the 2nd (need at least 2 — OK). Both met, so yes, 1008 is a multiple of 72 (1008 = 14 × 72). But 2916 = 2² · 3⁶ is NOT a multiple of 72: it has only two 2s, and 72 demands three.

Framing inspired by AoPS Prealgebra.

🎯 Try it
Is 2⁴ · 3 · 5² a multiple of 2² · 3 · 5? Type 1 for yes, 0 for no.
Walkthrough: check each prime the divisor needs: it wants 2² (the big number has 2⁴ — enough), 3¹ (has 3¹ — enough), 5¹ (has 5² — enough). Every demand is met, so YES — type 1.
WATCH OUT
Bogus solution

Ten people each factor 60. One writes 60 = 6 × 10, another 60 = 4 × 15, another 60 = 2 × 30. Different starting splits, so they’ll get different prime factorizations — the answer depends on how you start the tree.

Why it breaks: the Fundamental Theorem of Arithmetic says every integer has exactly one prime factorization. Keep going past those first splits and all three land on the same leaves: 2 × 2 × 3 × 5.

The fix: the FIRST split is your free choice; the FINAL primes are not. Any factor tree for a number ends on the same pile of primes — that pile is the number’s one true fingerprint.

WORKED EXAMPLE
PROBLEM · 2010 #14

What is the sum of the prime factors of 2010?

A) 67 B) 75 C) 77 D) 201 E) 210

Find the sum of the prime factors of 2010.

Don't grind. Read the number: it ends in 0, so it's 201 × 10. And 10 = 2 × 5 — two primes for free.

Now crack 201. Its digits add to 2+0+1 = 3, a multiple of 3, so 3 divides it: 201 = 3 × 67.

Is 67 prime? √67 ≈ 8.2, so test 2, 3, 5, 7: it's odd, digit sum 13 (not ÷3), doesn't end in 0/5, and 67 ÷ 7 isn't whole. Prime.

So 2010 = 2 × 3 × 5 × 67. Sum of the primes: 2 + 3 + 5 + 67 = 77.

Always look at the number before you divide. A trailing 0 hands you 2 and 5 instantly; a digit sum divisible by 3 hands you a 3. Peel off the easy primes by sight, then you only have one small number left to test.

Answer: C β€” 77.
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
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 hints
Hint 1 of 2
250 ends in 0, so it's even and a multiple of 5 — you already know its two smallest primes without dividing anything.
Still stuck? Show hint 2 →
Hint 2 of 2
The smallest prime factors hide in the last digit: even ⇒ 2 lives there; ending in 0 or 5 ⇒ 5 lives there.
Show solution
Approach: spot the primes from the last digit
  1. 250 ends in 0, which means it's divisible by both 2 and by 5 — the two smallest primes any number can have. So the two smallest are 2 and 5 with no work.
  2. Sum: 2 + 5 = 7.
  3. Why you can stop: 2 and 5 are the smallest two primes that exist, so once a number has both, nothing smaller can sneak in. (Fully, 250 = 2 · 53, but you never needed that.)
2009 Β· #6 The product of four different natural numbers is 100. What is the sum of the four numbers?

The product of four different natural numbers is 100. What is the sum of the four numbers?

Show answer
Answer: D — 18
Show hints
Hint 1 of 2
Write 100 as a product of four DIFFERENT whole numbers - the smallest will be 1.
Still stuck? Show hint 2 →
Hint 2 of 2
100 = 2^2 x 5^2; split those primes into four distinct factors.
Show solution
Approach: factor 100 into four distinct numbers
  1. 100 = 2^2 x 5^2. Using four different factors forces 1, 2, 5 and 10 (since 1x2x5x10 = 100).
  2. No other set of four distinct naturals multiplies to 100.
  3. Their sum is 1+2+5+10 = 18.
2013 Β· #10 For the positive whole numbers x, y, z the following is true: xΓ—y = 14, yΓ—z = 10 and zΓ—x = 35. What is the value of x + y + z?

For the positive whole numbers x, y, z the following is true: x×y = 14, y×z = 10 and z×x = 35. What is the value of x + y + z?

Show answer
Answer: C — 14
Show hints
Hint 1 of 2
Multiply all three equations together to get (xyz) squared.
Still stuck? Show hint 2 →
Hint 2 of 2
Once you know xyz, divide by each product to recover one variable at a time.
Show solution
Approach: multiply the equations
  1. (xy)(yz)(zx) = (xyz)Β² = 14 Γ— 10 Γ— 35 = 4900, so xyz = 70.
  2. x = xyz / yz = 70/10 = 7, y = 70/35 = 2, z = 70/14 = 5.
  3. x + y + z = 7 + 2 + 5 = 14.
2022 Β· #3 When three positive integers a, b, and c are multiplied together, their product is 100. Suppose a < b < c. In how many ways can the...

When three positive integers a, b, and c are multiplied together, their product is 100. Suppose a < b < c. In how many ways can the numbers be chosen?

Show answer
Answer: E — 4 ways.
Show hints
Hint 1 of 2
Because a < b < c, the smallest factor can't be big — if all three were that size the product would blow past 100. So fix a first; it has very few options.
Still stuck? Show hint 2 →
Hint 2 of 2
a must be a small factor of 100 (it's the least of three, so a³ < 100 ⇒ a ≤ 4). For each such a, split the leftover product into b < c.
Show solution
Approach: fix the smallest factor and list outward
  1. Insight: since a < b < c, the smallest factor a is the natural thing to pin down — it's tiny (if all three were as big as a, the product a³ would already exceed 100). So a can only be a small factor of 100.
  2. a = 1: then bc = 100 with b < c — (1,2,50), (1,4,25), (1,5,20).
  3. a = 2: then bc = 50 with 2 < b < c — only (2,5,10).
  4. Bigger a leaves no room (e.g. a = 4 would need bc = 25 with 4 < b < c, impossible). That gives 4 valid triples.
  5. Why fix the smallest: in any “a < b < c, fixed product” problem, the smallest is squeezed into a short list, so looping over it is the fast, miss-nothing path.
Another way — bound the smallest factor first (MAA):
  1. Since a < b < c and abc = 100, we get a3 < 100, so a ≤ 4. And a must be a factor of 100, so a ∈ {1, 2, 4}.
  2. For each: a = 1 gives (1,2,50), (1,4,25), (1,5,20); a = 2 gives (2,5,10); a = 4 gives nothing (would need bc = 25 with 4 < b < c).
  3. Total: 4 ways.
2023 Β· #22 In a sequence of positive integers, each term after the second is the product of the previous two terms. The sixth term in the sequence...

In a sequence of positive integers, each term after the second is the product of the previous two terms. The sixth term in the sequence is 4000. What is the first term?

Show answer
Answer: D — 5.
Show hints
Hint 1 of 2
Don't guess numbers — track structure. Call the first two terms a and b; every later term is a product, so it's just a and b raised to some powers. Watch how those powers grow.
Still stuck? Show hint 2 →
Hint 2 of 2
The exponents of a (and of b) each follow a Fibonacci-style add: the 6th term is a3b5. Now break 4000 into primes and match.
Show solution
Approach: track exponents of a and b through the sequence
  1. Let the first two terms be a, b. Each new term multiplies the previous two, which adds their exponents — so the exponents climb like Fibonacci: a, b, ab, ab2, a2b3, a3b5.
  2. So the 6th term is a3b5 = 4000. Factor: 4000 = 4 × 1000 = 22 × (2×5)3 = 25 × 53. Matching the cube to a3 and the fifth power to b5 gives a = 5, b = 2.
  3. First term: 5. Sanity check: the sequence reads 5, 2, 10, 20, 200, 4000 — the 6th term hits 4000. Worth keeping: in any ‘multiply the previous two’ sequence, the exponents of the two starting values follow the Fibonacci numbers.
2020 Β· #24 Let N be the smallest positive number such that half of N is divisible by 2, one-third of N is divisible by 3, one-quarter of N is...

Let N be the smallest positive number such that half of N is divisible by 2, one-third of N is divisible by 3, one-quarter of N is divisible by 4, one-fifth of N is divisible by 5, one-sixth of N is divisible by 6, one-eighth of N is divisible by 8, and one-ninth of N is divisible by 9. The square root of N is a number of how many digits?

Show answer
Answer: A — 3
Show hints
Hint 1 of 2
'Half of N divisible by 2' means N is a multiple of 4; turn each clue into a divisibility of N.
Still stuck? Show hint 2 →
Hint 2 of 2
Take the least common multiple of all those requirements, then count the digits of its square root.
Show solution
Approach: translate the clues, then take the LCM
  1. The clues say N is a multiple of 4, 9, 16, 25, 36, 64 and 81.
  2. Their least common multiple is N = 129600.
  3. √129600 = 360, which has 3 digits.
  4. The answer is 3, choice A.
β˜… 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
Whole weeks change nothing β€” 7 days later is the same weekday. So toss out the full weeks and only the *leftover* days matter.
Still stuck? Show hint 2 →
Hint 2 of 2
Split 706 cleverly: 706 = 700 + 6, and 700 is a clean stack of weeks (7 Γ— 100). That leaves just 6 days to walk forward.
Show solution
Approach: strip off the whole weeks (multiples of 7)
  1. The weekday repeats every 7 days, so anything that's a multiple of 7 is invisible. Peel 706 into 700 + 6: those 700 days are exactly 100 weeks and land you right back on Saturday.
  2. Now just step 6 days past Saturday: Sun, Mon, Tue, Wed, Thu, Friday.
  3. *The reusable trick:* for any "what day/position after N steps" question with a cycle of length 7, only the *leftover* of N after pulling out whole cycles matters β€” break N into (multiple of 7) + (small remainder).
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 hints
Hint 1 of 2
250 ends in 0, so it's even and a multiple of 5 — you already know its two smallest primes without dividing anything.
Still stuck? Show hint 2 →
Hint 2 of 2
The smallest prime factors hide in the last digit: even ⇒ 2 lives there; ending in 0 or 5 ⇒ 5 lives there.
Show solution
Approach: spot the primes from the last digit
  1. 250 ends in 0, which means it's divisible by both 2 and by 5 — the two smallest primes any number can have. So the two smallest are 2 and 5 with no work.
  2. Sum: 2 + 5 = 7.
  3. Why you can stop: 2 and 5 are the smallest two primes that exist, so once a number has both, nothing smaller can sneak in. (Fully, 250 = 2 · 53, but you never needed that.)
2009 Β· #6 The product of four different natural numbers is 100. What is the sum of the four numbers?

The product of four different natural numbers is 100. What is the sum of the four numbers?

Show answer
Answer: D — 18
Show hints
Hint 1 of 2
Write 100 as a product of four DIFFERENT whole numbers - the smallest will be 1.
Still stuck? Show hint 2 →
Hint 2 of 2
100 = 2^2 x 5^2; split those primes into four distinct factors.
Show solution
Approach: factor 100 into four distinct numbers
  1. 100 = 2^2 x 5^2. Using four different factors forces 1, 2, 5 and 10 (since 1x2x5x10 = 100).
  2. No other set of four distinct naturals multiplies to 100.
  3. Their sum is 1+2+5+10 = 18.
CHAPTER 4

Counting divisors β€” exponent + 1, multiplied

THEORY

How many divisors does 1,000,000 have? Listing them would take all afternoon. But once you know its prime factorization, you can name the count — 49 — in one line, without writing a single divisor down. Here's the formula that does it.

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? Watch a divisor get BUILT. Every divisor is built by choosing how many copies of each prime to include. Take 40 = 2³ · 5. To build a divisor, you make two choices: how many 2s (you can take 0, 1, 2, or 3 — four options), and how many 5s (0 or 1 — two options).

A divisor of 40 = 2³·5 is ONE choice per primehow many 2s?2⁰4 choiceshow many 5s?5⁰2 choices4 × 2 = 8 divisorspick one box from each row — every combination is a different divisor

Pick one box from the top row and one from the bottom row, and you've built a divisor. 2¹ · 5⁰ = 2, 2³ · 5¹ = 40, 2⁰ · 5⁰ = 1 — every combination is different, and there are 4 × 2 = 8 of them. The “+1” means “don't forget the option of taking ZERO of that prime.” That's why you count (3+1) twos and (1+1) fives, then multiply.

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).

See it with 40. List the pairs from the outside in — small factor on the left, its partner on the right — and they march toward the middle:

Factors of 40 come in PAIRS that multiply to 40140×220×410×58×the seam sits at √40 ≈ 6.3smallbig4 pairs give 8 factors. No pair lands ON the seam, so the count is EVEN.

Now watch what's different about a perfect square. Do the same for 36, and the innermost pair turns out to be 6 × 6 — the two halves are the SAME number, so they fold into one:

But 36 is a perfect square — the middle pair is 6×6136×218×312×49×6 × 6← one number, not a pair4 pairs plus the lone 6 give 9 factors. The seam IS √36, so the count is ODD.

That lone middle number is √36 = 6, pairing with itself. Every other divisor still comes in a clean pair, but that one stands alone — so a perfect square always has an ODD count, and every other number has an even count.

A number is a perfect square ↔ it has an ODD number of divisors. The middle pair is √n × √n — one number, not two.

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).

🎯 Try it
How many positive divisors does 60 have? (Hint: 60 = 2² × 3 × 5.)
Walkthrough: exponents are 2, 1, 1. Add one to each and multiply: (2+1)(1+1)(1+1) = 3 × 2 × 2 = 12. The trap: forgetting that the primes 3 and 5 (exponent 1) each still contribute a factor of 2.

Adding up the divisors — multiply the prime-power sums

Same idea as counting, but now you want the TOTAL of all the divisors, not only how many. Listing and adding works for small numbers, but it gets slow fast.

Slow way for 20. Divisors are 1, 2, 4, 5, 10, 20. Add: 1 + 2 + 4 + 5 + 10 + 20 = 42. Fine for 20. Painful for 360.

Here’s the shortcut. Factor: 20 = 2² × 5. Write a little sum for each prime — all its powers from p0 up to the top — then MULTIPLY the sums:

(1 + 2 + 4) × (1 + 5) = 7 × 6 = 42

Same 42, no listing. Why does multiplying work? When you expand (1 + 2 + 4)(1 + 5) the regular way, every term is one power of 2 times one power of 5 — and that’s exactly the recipe for a divisor. The grid below shows the expansion landing on all six divisors:

(1 + 2 + 4) × (1 + 5) hands you every divisor of 20× 1× 5115221044201 + 2 + 4 + 5 + 10 + 20 = 42shortcut: (1+2+4)(1+5) = 7 × 6 = 42 — no listing needed

Read the cells: that's 1, 2, 4 across the top of each column times 1 or 5 — every divisor of 20 appears once, so adding them all is the same as multiplying the two bracket-sums.

SUM OF DIVISORS

If n = pa · qb · …, the sum of ALL its divisors is

(1 + p + … + pa) × (1 + q + … + qb) × …

One bracket per prime — list its powers, add, then multiply the brackets.

Bigger example. Sum of the divisors of 72 = 2³ · 3²: (1 + 2 + 4 + 8)(1 + 3 + 9) = 15 × 13 = 195. Try listing all twelve divisors of 72 and adding — you’ll get 195 too, the slow way.

🎯 Try it
What is the sum of all the positive divisors of 12? (Hint: 12 = 2² × 3.)
Walkthrough: one bracket per prime: (1 + 2 + 4)(1 + 3) = 7 × 4 = 28. Check by listing: 1 + 2 + 3 + 4 + 6 + 12 = 28. ✓

Framing inspired by Competition Math for Middle School (AoPS).

Counting only the ODD divisors (or only the EVEN ones)

Sometimes a problem only wants the odd factors, or only the even ones. Don’t list and sort — the prime factorization splits them for you.

The key fact: a divisor is odd exactly when it has NO factor of 2. So to count odd divisors, cover up the power of 2 in the factorization and count the divisors of what’s left.

Example. How many odd divisors does 120 = 2³ · 3 · 5 have? Ignore the — the odd divisors come only from 3 · 5. Count those: (1+1)(1+1) = 4 (they are 1, 3, 5, 15).

And the EVEN divisors? Don’t count them one by one — subtract. Total divisors of 120: (3+1)(1+1)(1+1) = 16. Even ones = total − odd = 16 − 4 = 12. That’s complementary counting: count the easy set, subtract from the whole.

Odd divisors: cover the 2’s, count what’s left. Even divisors: total minus odd.

Framing inspired by Competition Math for Middle School (AoPS).

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Β² βœ“.

WATCH OUT
Bogus solution

How many divisors does 48 = 2⁴ · 3 have? The exponents are 4 and 1. Multiply the exponents: 4 × 1 = 4 divisors.

Why it breaks: you forgot the “take ZERO of this prime” option for each prime — that’s the +1. Multiplying the raw exponents skips it entirely, and the lone prime 3 (exponent 1) silently contributes nothing.

The fix: add 1 to each exponent FIRST, then multiply: (4+1)(1+1) = 5 × 2 = 10 divisors. Check by listing: 1, 2, 3, 4, 6, 8, 12, 16, 24, 48 — ten. It’s (exponent + 1) per prime, multiplied — never the bare exponents.

WORKED EXAMPLE
PROBLEM · 1996 #1

How many positive factors of 36 are also multiples of 4?

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

How many positive factors of 36 are also multiples of 4?

Your instinct is to list all nine factors of 36 and check each for divisibility by 4. Resist it — there's a slicker move.

A number that is BOTH a factor of 36 AND a multiple of 4 already has the 4 built in. So write it as 4 × k. For that to divide 36, the leftover k must divide 36 ÷ 4 = 9.

So the question collapses to: how many factors does 9 have? 9 = 3², so by the formula it has (2+1) = 3 factors: 1, 3, 9.

Multiply each by 4: 4, 12, 36. That's 3 numbers — and you never listed all of 36's divisors.

“Count the multiples of d that also divide N” always becomes “count the factors of N ÷ d.” Pulling out the forced factor shrinks the problem, then the divisor-count formula finishes it.

Answer: B β€” 3.
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
2007 Β· #10 For any positive integer n, define [n] to be the sum of the positive factors of n. For example, [6] = 1 + 2 + 3 + 6 = 12. Find [[11]].

For any positive integer n, define [n] to be the sum of the positive factors of n. For example, [6] = 1 + 2 + 3 + 6 = 12. Find [[11]].

Show answer
Answer: D — 28.
Show hints
Hint 1 of 2
Nested brackets mean work inside-out: settle [11] completely before touching the outer bracket. The clue is that 11 is prime — its only factors are 1 and itself.
Still stuck? Show hint 2 →
Hint 2 of 2
Factors come in pairs: list divisors as pairs that multiply to n (1&12, 2&6, 3&4) so you never miss one.
Show solution
Approach: evaluate the inner bracket first, then the outer
  1. Inner first: 11 is prime, so its only factors are 1 and 11 ⇒ [11] = 1 + 11 = 12.
  2. Now [12]. Pair up the divisors so none escape: 1·12, 2·6, 3·4 — that's {1, 2, 3, 4, 6, 12}.
  3. Add them: 1 + 2 + 3 + 4 + 6 + 12 = 28.
  4. Habit worth forming: finding divisors in multiply-to-n pairs guarantees a complete list — the same trick that makes counting factors fast.
2014 Β· #5 The product of two natural numbers is 36, and their sum is 37. What is the (positive) difference between the two numbers?

The product of two natural numbers is 36, and their sum is 37. What is the (positive) difference between the two numbers?

Show answer
Answer: E — 35
Show hints
Hint 1 of 2
List the factor pairs of 36 and check which pair adds to 37.
Still stuck? Show hint 2 →
Hint 2 of 2
A pair multiplying to 36 and adding to 37 must be far apart, not close together.
Show solution
Approach: find the factor pair of 36 that sums to 37
  1. The factor pairs of 36 are 1Γ—36, 2Γ—18, 3Γ—12, 4Γ—9, 6Γ—6.
  2. Their sums are 37, 20, 15, 13, 12 β€” only 1 and 36 give the sum 37.
  3. The difference is 36 βˆ’ 1 = 35.
2022 Β· #3 When three positive integers a, b, and c are multiplied together, their product is 100. Suppose a < b < c. In how many ways can the...

When three positive integers a, b, and c are multiplied together, their product is 100. Suppose a < b < c. In how many ways can the numbers be chosen?

Show answer
Answer: E — 4 ways.
Show hints
Hint 1 of 2
Because a < b < c, the smallest factor can't be big — if all three were that size the product would blow past 100. So fix a first; it has very few options.
Still stuck? Show hint 2 →
Hint 2 of 2
a must be a small factor of 100 (it's the least of three, so a³ < 100 ⇒ a ≤ 4). For each such a, split the leftover product into b < c.
Show solution
Approach: fix the smallest factor and list outward
  1. Insight: since a < b < c, the smallest factor a is the natural thing to pin down — it's tiny (if all three were as big as a, the product a³ would already exceed 100). So a can only be a small factor of 100.
  2. a = 1: then bc = 100 with b < c — (1,2,50), (1,4,25), (1,5,20).
  3. a = 2: then bc = 50 with 2 < b < c — only (2,5,10).
  4. Bigger a leaves no room (e.g. a = 4 would need bc = 25 with 4 < b < c, impossible). That gives 4 valid triples.
  5. Why fix the smallest: in any “a < b < c, fixed product” problem, the smallest is squeezed into a short list, so looping over it is the fast, miss-nothing path.
Another way — bound the smallest factor first (MAA):
  1. Since a < b < c and abc = 100, we get a3 < 100, so a ≤ 4. And a must be a factor of 100, so a ∈ {1, 2, 4}.
  2. For each: a = 1 gives (1,2,50), (1,4,25), (1,5,20); a = 2 gives (2,5,10); a = 4 gives nothing (would need bc = 25 with 4 < b < c).
  3. Total: 4 ways.
2025 Β· #22 (figure problem)
Figure for AMC 8 2025 Problem 22
Show answer
Answer: D — 7 different coat counts.
Show hints
Hint 1 of 2
The annoying part is that the gap after the last coat has no coat closing it off, unlike the gaps between coats. Fix that asymmetry: imagine one phantom coat on a 36th hook, and now empty-then-coat repeats perfectly.
Still stuck? Show hint 2 →
Hint 2 of 2
With the phantom, 36 hooks split into d identical blocks of length b (each = some empties + one coat), so bd = 36 with b ≥ 2 and d ≥ 2. Counting the coat-arrangements becomes counting these factorizations.
Show solution
Approach: add a phantom coat to make a clean repeat, then count factor pairs
  1. The setup is fiddly because the trailing gap isn't followed by a coat the way the inner gaps are. Patch it: drop a phantom coat on a 36th hook. Now the whole row is a flawless repeat of (some empty hooks)+(one coat), each block of length b ≥ 2.
  2. If there are d such blocks, bd = 36, and the real coat count is d − 1 (we added one phantom). The constraints are b ≥ 2 (each block has ≥ 1 empty + 1 coat) and d ≥ 2 (≥ 1 real coat plus the phantom).
  3. So just count factorizations 36 = b × d with both factors ≥ 2. Since 36 = 22 × 32 has (2+1)(2+1) = 9 divisors, and we drop the two using a 1 (1×36, 36×1), the answer is 9 − 2 = 7.
  4. Why this transfers: when boundary items spoil a repeating pattern, add (or remove) a phantom to restore the symmetry — the awkward "ends differ from the middle" complication melts into a clean periodic count.
2009 Β· #25 All factors of a number N (with the exception of 1 and N itself) are written down one after the other. It turns out that the biggest...

All factors of a number N (with the exception of 1 and N itself) are written down one after the other. It turns out that the biggest factor is 45 times as big as the smallest factor. For how many numbers N is that true?

Show answer
Answer: C — 2
Show hints
Hint 1 of 2
The smallest factor above 1 is the least prime p; the largest below N is N/p.
Still stuck? Show hint 2 →
Hint 2 of 2
Set N/p = 45p, so N = 45 p^2, and check p is really the smallest prime of N.
Show solution
Approach: translate the factor condition into N = 45 p^2
  1. The condition (largest proper factor) = 45 x (smallest proper factor) gives N/p = 45p, so N = 45 p^2.
  2. Because 45 = 3^2 x 5, N always has factor 3, so the smallest prime p can only be 2 or 3: p=2 gives N=180, p=3 gives N=405, both valid.
  3. Hence there are 2 such numbers.
2024 Β· #25 Dagobert wants to complete the diagram so that each box in the middle and top rows equals the product of the two boxes directly...

Dagobert wants to complete the diagram so that each box in the middle and top rows equals the product of the two boxes directly underneath it. Each box must contain a positive whole number, and he wants the top box to contain 36. How many different values can the number n have?

Figure for Math Kangaroo 2024 Problem 25
Show answer
Answer: D — 4
Show hints
Hint 1 of 2
Write the top box as a product of the three bottom boxes, with n appearing twice.
Still stuck? Show hint 2 →
Hint 2 of 2
The top equals the bottom product with an n-squared factor, so n-squared must divide 36.
Show solution
Approach: express the top as a product and require n-squared divides 36
  1. With bottom boxes x, n, y, the middle row is xn and ny, and the top is xn · ny = x·y·n² = 36.
  2. So n² must divide 36: n can be 1, 2, 3 or 6.
  3. Each choice leaves a valid positive product for x·y, so n has 4 possible values.
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 (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.

🎯 Try it
Two lighthouses flash — one every 6 seconds, one every 8 seconds. They flashed together a moment ago. How many seconds until they flash together again?
Walkthrough: “line up again” means LCM. 6 = 2×3, 8 = 2³. Take the larger power of each prime: 2³ × 3 = 24 seconds. (The trap: answering 14 by adding, or 48 by multiplying — neither is the LCM.)

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. Most contest problems use small numbers where factoring is fine, but the algorithm is good to have in your back pocket.

Two remainders at once — find where they line up

LCM tells you when two cycles sync up exactly. Sometimes they line up at an offset instead. Here's the classic version:

Find the smallest positive whole number that leaves remainder 1 when divided by 6, and remainder 6 when divided by 11.

Don't set up equations. List each cycle and look for the first match.

  • Remainder 1 when divided by 6: 1, 7, 13, 19, 25, 31, 37, 43, 49, 55, 61, …
  • Remainder 6 when divided by 11: 6, 17, 28, 39, 50, 61, …

The first number in both lists is 61. Done.

Here's the payoff: once you have one answer, the next ones come every LCM(6, 11) = 66. So the whole family is 61, 127, 193, … — start at 61, step by 66.

List the cycles, grab the first match, then step by the LCM.

The “one short” shortcut — when every remainder is divisor − 1

Some remainder problems collapse to one line if you spot the pattern. Here’s the classic:

Find the smallest whole number bigger than 1 that leaves remainder 5 when divided by 6, remainder 6 when divided by 7, and remainder 7 when divided by 8.

Don’t list anything. Notice each remainder is exactly one less than its divisor: 5 = 6−1, 6 = 7−1, 7 = 8−1. “One short of a clean multiple” is the same as saying n + 1 is a clean multiple. So n + 1 is divisible by 6, 7, AND 8 at once — that means n + 1 is a multiple of LCM(6, 7, 8).

LCM(6, 7, 8) = 168 (take 2³ from the 8, 3 from the 6, 7 from the 7). The smallest such n + 1 is 168, so n = 167. Check: 167 = 27×6 + 5 ✓, 167 = 23×7 + 6 ✓, 167 = 20×8 + 7 ✓.

If every remainder is (its divisor − 1), then n + 1 is divisible by all the divisors: answer = LCM − 1. (And if every remainder is 1, the answer is LCM + 1.)
🎯 Try it
What is the smallest whole number bigger than 1 that leaves remainder 2 when divided by 3, remainder 3 when divided by 4, and remainder 4 when divided by 5?
Walkthrough: each remainder is one short of its divisor (2 = 3−1, 3 = 4−1, 4 = 5−1), so n + 1 is divisible by 3, 4, and 5. LCM(3, 4, 5) = 60, so n = 60 − 1 = 59. Check: 59 = 19×3 + 2, 14×4 + 3, 11×5 + 4 ✓.

Scaling — factor out the common piece

When two numbers share an obvious common chunk, pull it out FIRST. GCD and LCM both scale with it:

SCALING IDENTITIES

gcd(na, nb) = n · gcd(a, b)    and    lcm[na, nb] = n · lcm[a, b]

Multiplying both numbers by n multiplies both their GCD and their LCM by n.

See it small. 24 and 36 are both 12 times something: 24 = 12×2, 36 = 12×3. So gcd(24, 36) = 12 · gcd(2, 3) = 12 · 1 = 12, and lcm[24, 36] = 12 · lcm[2, 3] = 12 · 6 = 72. No factor tree needed.

See it big. What is lcm[606060, 707070]? Both are 10101 times something: 606060 = 10101 × 60, 707070 = 10101 × 70. Pull out the 10101: lcm = 10101 · lcm[60, 70]. Now 60 = 2²·3·5 and 70 = 2·5·7, so lcm[60, 70] = 2²·3·5·7 = 420. Thus lcm = 10101 × 420 = 4,242,420 — and you never factored the six-digit monsters.

Coprime shortcut — LCM is just the product

When two numbers share NO common factor (GCD 1, relatively prime), there’s no overlap to worry about, so their LCM is the whole product:

if gcd(a, b) = 1, then lcm[a, b] = a × b

For example lcm[8, 15] = 8 × 15 = 120 (8 = 2³, 15 = 3·5 — nothing shared). This also drops straight out of the identity gcd × lcm = a × b when the GCD is 1.

🎯 Try it
Find lcm[600, 900] by factoring out the common 300 first. (Hint: 600 = 300×2, 900 = 300×3.)
Walkthrough: pull out the shared 300: lcm[600, 900] = 300 · lcm[2, 3]. Since 2 and 3 are coprime, lcm[2, 3] = 2 × 3 = 6, so lcm = 300 × 6 = 1800. (Check: 1800 = 600×3 = 900×2 ✓.)

(Remainder problem adapted from Problem Solving via the AMC, Australian Maths Trust.)

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 you'll meet are one of these two patterns dressed up in a story.

WATCH OUT
Bogus solution

Three bells ring every 15, 20, and 25 minutes. They rang together a moment ago. When do all three ring together again? Use the identity from above and multiply: 15 × 20 × 25 = 7500 minutes.

Why it breaks: two things go wrong. First, GCD × LCM = a × b works only for TWO numbers — it says nothing about three. Second, “ring together” means a COMMON multiple, and the first one is the least common multiple, not the product.

The fix: take the LCM the safe way — highest power of each prime. 15 = 3 · 5, 20 = 2² · 5, 25 = 5², so LCM = 2² · 3 · 5² = 300 minutes. The product 7500 is a common multiple, but it’s 25 times too big. “Meet again” is the LCM — build it prime by prime, never by multiplying the numbers.

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 the plain “two cycles must finish together” pattern. 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
2016 Β· #9 Alex has one rope 1Β m long and another 2Β m long. He cuts up both ropes so that all the pieces are of equal length. Which of the...

Alex has one rope 1 m long and another 2 m long. He cuts up both ropes so that all the pieces are of equal length. Which of the following numbers of pieces can he not obtain this way?

Show answer
Answer: B — 8
Show hints
Hint 1 of 2
Every piece must fit a whole number of times into the 1 m rope and into the 2 m rope.
Still stuck? Show hint 2 →
Hint 2 of 2
If each piece is 1/n of a metre, the short rope gives n pieces and the long rope gives 2n, so the total is always a multiple of 3.
Show solution
Approach: the total number of pieces is always a multiple of 3
  1. Equal pieces must divide both ropes exactly, so each piece is 1/n of a metre for some whole number n.
  2. Then the 1 m rope makes n pieces and the 2 m rope makes 2n pieces, for 3n pieces in all — always a multiple of 3.
  3. Among the options 6, 9, 12 and 15 are multiples of 3, but 8 is not, so 8 pieces cannot be obtained.
2013 Β· #10 For the positive whole numbers x, y, z the following is true: xΓ—y = 14, yΓ—z = 10 and zΓ—x = 35. What is the value of x + y + z?

For the positive whole numbers x, y, z the following is true: x×y = 14, y×z = 10 and z×x = 35. What is the value of x + y + z?

Show answer
Answer: C — 14
Show hints
Hint 1 of 2
Multiply all three equations together to get (xyz) squared.
Still stuck? Show hint 2 →
Hint 2 of 2
Once you know xyz, divide by each product to recover one variable at a time.
Show solution
Approach: multiply the equations
  1. (xy)(yz)(zx) = (xyz)Β² = 14 Γ— 10 Γ— 35 = 4900, so xyz = 70.
  2. x = xyz / yz = 70/10 = 7, y = 70/35 = 2, z = 70/14 = 5.
  3. x + y + z = 7 + 2 + 5 = 14.
2017 Β· #24 Mrs. Sanders has three grandchildren, who call her regularly. One calls her every three days, one calls her every four days, and one...

Mrs. Sanders has three grandchildren, who call her regularly. One calls her every three days, one calls her every four days, and one calls her every five days. All three called her on December 31, 2016. On how many days during the next year did she not receive a phone call from any of her grandchildren?

Show answer
Answer: D — 146 days.
Show hints
Hint 1 of 2
Don't track 365 days — the call pattern is periodic. After lcm(3,4,5) = 60 days all three are back in sync, so figure out one 60-day block and the rest is copy-paste.
Still stuck? Show hint 2 →
Hint 2 of 2
Count no-call days = 60 − (call days), and find call days by inclusion–exclusion: add the every-3, every-4, every-5 counts, subtract the overlaps (every-12, every-15, every-20), add back the triple (every-60).
Show solution
Approach: find one 60-day cycle by inclusion–exclusion, then tile
  1. The three grandchildren realign every lcm(3, 4, 5) = 60 days, so the whole year is just copies of one 60-day block. Solving one block solves everything.
  2. Call days in 60 by inclusion–exclusion: 20 (÷3) + 15 (÷4) + 12 (÷5) − 5 (÷12) − 4 (÷15) − 3 (÷20) + 1 (÷60) = 36. So no-call days = 60 − 36 = 24 per block.
  3. The year is 365 = 6×60 + 5 days. The six full blocks give 6 × 24 = 144 no-call days.
  4. Handle the 5 leftover days (days 361–365, which restart the cycle as days 1–5): day 1 no, day 2 no, day 3 call, day 4 call, day 5 call — 2 more no-call days.
  5. Total: 144 + 2 = 146.
  6. Why this transfers: periodic-event problems collapse to one lcm-length cycle; inclusion–exclusion handles the overlaps, and the only care needed is the partial cycle at the end.
2024 Β· #22 Daniel wants to cut a rope into 12 equal pieces and marks the places where he has to cut. Mohammed wants to cut the same rope into 16...

Daniel wants to cut a rope into 12 equal pieces and marks the places where he has to cut. Mohammed wants to cut the same rope into 16 equal pieces and marks his cuts as well. Maya finally cuts the rope at all the marked spots. How many pieces does Maya get?

Show answer
Answer: A — 24
Show hints
Hint 1 of 2
Count the marks each boy makes (11 for twelve pieces, 15 for sixteen pieces), but watch for marks that land on the same spot.
Still stuck? Show hint 2 →
Hint 2 of 2
Shared marks happen where the fractions agree; subtract those once, and remember the number of pieces is one more than the number of cuts.
Show solution
Approach: inclusion-exclusion on the cut marks, then add one
  1. Daniel makes 11 marks (at 1/12, 2/12, …, 11/12) and Mohammed makes 15 marks (at 1/16, …, 15/16).
  2. Marks coincide where the positions match, which happens at 1/4, 1/2 and 3/4 β€” that is 3 shared marks.
  3. Distinct cut points: 11 + 15 βˆ’ 3 = 23.
  4. Cutting at 23 points gives 23 + 1 = 24 pieces.
2019 Β· #21 n buttons are placed evenly around a circle. The buttons are labelled clockwise in order with the numbers 1 to n. The button numbered 7...

n buttons are placed evenly around a circle. The buttons are labelled clockwise in order with the numbers 1 to n. The button numbered 7 is exactly opposite the button numbered 23. How big is n?

Figure for Math Kangaroo 2019 Problem 21
Show answer
Answer: B — 32
Show hints
Hint 1 of 2
Two buttons are exactly opposite when they are half the circle apart.
Still stuck? Show hint 2 →
Hint 2 of 2
The gap between button 7 and button 23 is therefore n/2.
Show solution
Approach: opposite means a half-circle apart
  1. If buttons 7 and 23 are exactly opposite, they are n/2 positions apart.
  2. The gap from 7 to 23 is 23 − 7 = 16, so n/2 = 16.
  3. Therefore n = 32.
2011 Β· #20 10 children are at a judo club. Their teacher has 80 sweets. If he gives each girl the same amount of sweets, there are three sweets...

10 children are at a judo club. Their teacher has 80 sweets. If he gives each girl the same amount of sweets, there are three sweets left over. How many boys are at the club?

Show answer
Answer: C — 3
Show hints
Hint 1 of 2
Take away the 3 leftover sweets; the rest split evenly among the girls.
Still stuck? Show hint 2 →
Hint 2 of 2
The number of girls must divide that leftover-free amount exactly, and be fewer than 10.
Show solution
Approach: share the leftover-free sweets evenly among the girls
  1. After 3 are left over, 80 βˆ’ 3 = 77 sweets are shared equally among the girls.
  2. 77 splits evenly only into 7 groups of 11 (or 11 groups of 7), and only 7 girls fits a club of 10, so there are 7 girls.
  3. Then boys = 10 βˆ’ 7 = 3.
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.)

Place value — what each digit is really worth

A digit sum throws away WHERE each digit sits. But a lot of contest problems are about exactly that — the position. The number 358 is not “3 and 5 and 8.” It’s

358hundredstensones3 × 1005 × 108 × 1358 = 300 + 50 + 8

That “break it into place pieces” move is the whole idea. A two-digit number with tens digit a and ones digit b is 10a + b. A three-digit number is 100a + 10b + c. Write it that way and the position does the work.

Biggest number? Biggest digit in the highest seat.

You’re handed some digits and asked for the LARGEST number you can build. A spot worth 100 beats a spot worth 10, which beats a spot worth 1. So the biggest digit should grab the most valuable seat.

To make the biggest number, sort the digits from large to small and read them left to right. For the smallest, sort small to large (but a leading 0 isn’t allowed — swap it with the first nonzero digit).
🎯 Try it
Using the digits 1, 3, 5, 9 each once, what is the largest four-digit number?
Walkthrough: sort big to small: 9, 5, 3, 1. Read it off: 9531.

Palindromes and reversing digits

A palindrome reads the same forwards and backwards: 121, 3443, 7. Build one from the outside in — the first and last digit must match, then the next pair in, and so on.

And here’s a slick fact about reversing a two-digit number. The number is 10a + b; its reversal is 10b + a. Add them: 10a + b + 10b + a = 11(a + b). Reversal-sums are always multiples of 11. Subtract instead and you get 9(a − b) — always a multiple of 9. Place value turns “reverse the digits” into clean algebra.

WORKED EXAMPLE — kangaroo-2025-kadett-01

Lisa makes 2025 out of four wooden digits: 2, 0, 2, 5. What is the LARGEST number she can build from those same four digits?

Don’t shuffle randomly. Use the rule: biggest digit in the highest seat. Sort 2, 0, 2, 5 from large to small: 5, 2, 2, 0.

Read it off: 5220. (The 0 has to land in the ones seat — the least valuable spot — which is exactly where the smallest digit belongs.)

Place value means each seat has a weight. Put your biggest digit where the weight is biggest.

Cryptarithms — when letters stand for digits

Some puzzles hide the digits behind letters or boxes: ABC + CBA = DDDD, or ?? × ? = 176. The rule is always the same — different letters are different digits, the same letter is the same digit every time. Your instinct is to try random digits. Resist it. Use place value plus one toehold fact.

The toehold: a repeated-digit number is a multiple. dd = 11d (so 44 = 11×4). aba-style and abab-style numbers hide a factor too (abab = ab × 101). Spotting that one factor usually cracks the puzzle.

Warm-up. The SAME digit fills every box: ?? × ? = 176. Call it d. The two-digit box ?? is dd = 11d, so 11d × d = 176, i.e. 11d² = 176. Divide: d² = 16, so d = 4. Check: 44 × 4 = 176 ✓. The hidden factor 11 cracked it instantly.

WORKED EXAMPLE — kangaroo-2010-benjamin-22

In PPQ × Q = RQ5Q, the letters P, Q, R are three different digits. Find P + Q + R.

Start at the ONES column — it leaks the most. The last digit of Q × Q has to be Q again. Run through digits: only 6 × 6 = 36 ends in 6 (and gives a four-digit product), so Q = 6.

Now the number is PP6 × 6 and the result looks like R656. Test the few PP6 values: 776 × 6 = 4656 — that fits R656 with R = 4. So P = 7, Q = 6, R = 4.

P + Q + R = 7 + 6 + 4 = 17.

Different letters = different digits. Pin the units column first, then let place value finish it.

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 · 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. What number did Yunji leave out?

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

Yunji adds the integers 1 through 9 but accidentally leaves one out. Her wrong sum turns out to be a perfect square. Which number did she leave out?

Your instinct is to test all nine cases. Lighter path: find the FULL total first, then the answer is that total minus one small number.

The full sum 1 + 2 + … + 9 pairs up nicely: 1+9, 2+8, 3+7, 4+6 are four 10s, plus a lonely 5 — that's 45.

Dropping one number (1 to 9) leaves a sum somewhere between 45 − 9 = 36 and 45 − 1 = 44. Which perfect square lives in 36–44? Only 36 = 6² (the next square, 49, is too big).

So the leftover sum was 36, and the missing number is 45 − 36 = 9.

When something is “almost” a number you know, compute the whole thing once, then handle the small correction. The digit-sum/pairing habit gives you 45 instantly, and the perfect-square window does the rest — no nine-case grind.

Answer: E β€” She left out 9.
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
2001 Β· #4 The digits 1, 2, 3, 4, and 9 are each used once to form the smallest possible even five-digit number. The digit in the tens place is

The digits 1, 2, 3, 4, and 9 are each used once to form the smallest possible even five-digit number. The digit in the tens place is

Show answer
Answer: E — 9.
Show hints
Hint 1 of 2
Leftmost digits matter most for size, so they should be smallest β€” but one rule overrides that: "even" forces the units digit to be 2 or 4.
Still stuck? Show hint 2 →
Hint 2 of 2
Satisfy the hard rule (even ending) first, then make everything to its left as small as possible.
Show solution
Approach: small digits left, but keep the number even
  1. The most-significant digits control size most, so we want 1, 2, 3 up front. That parks 4 and 9 in the last two slots.
  2. But the number must be even, so the units digit is the even one of {4, 9} β€” that's 4. The 9 is forced into the tens place: 12394.
  3. So the tens digit is 9. The lesson: when a constraint (here "even") locks one position, honor it first, then greedily minimize the rest left-to-right.
2002 Β· #4 The year 2002 is a palindrome (a number that reads the same from left to right as it does from right to left). What is the product of...

The year 2002 is a palindrome (a number that reads the same from left to right as it does from right to left). What is the product of the digits of the next year after 2002 that is a palindrome?

Show answer
Answer: B — 4.
Show hints
Hint 1 of 2
To stay as close to 2002 as you can, leave the thousands digit at 2 β€” bumping it would jump you all the way past 3000. So the year looks like 2 ? ? 2.
Still stuck? Show hint 2 →
Hint 2 of 2
A palindrome is locked by its *front half*: the mirror forces the two middle digits to match. Pick the smallest matching pair that still lands you above 2002.
Show solution
Approach: build the next palindrome from the outside in
  1. Key idea: you only get to *choose* the first half of a palindrome β€” the back half is its mirror. Keep the leading 2 (raising it overshoots wildly), so the year is 2 ? ? 2.
  2. The middle two digits must be equal. "00" gives 2002 (not *after*), so the next-smallest equal pair is "11" β†’ 2112. Its digit product is 2 × 1 × 1 × 2 = 4.
  3. *This transfers:* to find the next palindrome, only nudge the first half upward and mirror it β€” you never have to scan years one by one.
2014 Β· #5 What is the difference between the smallest five-digit number and the biggest four-digit number?

What is the difference between the smallest five-digit number and the biggest four-digit number?

Show answer
Answer: A — 1
Show hints
Hint 1 of 2
Write down the smallest five-digit number and the largest four-digit number.
Still stuck? Show hint 2 →
Hint 2 of 2
Those two numbers are right next to each other on the number line.
Show solution
Approach: name the two numbers and subtract
  1. The smallest five-digit number is 10000 and the largest four-digit number is 9999.
  2. These are consecutive whole numbers, so their difference is 1.
2022 Β· #3 Beate arranges five cards β€” 4, 8, 31, 59 and 107 β€” side by side to make the smallest possible nine-digit number. Which card ends up...

Beate arranges five cards — 4, 8, 31, 59 and 107 — side by side to make the smallest possible nine-digit number. Which card ends up furthest to the right?

Show answer
Answer: B — 8
Show hints
Hint 1 of 2
To make the joined number smallest, the cards with the smallest leading digit should sit furthest to the left.
Still stuck? Show hint 2 →
Hint 2 of 2
Order the five cards by the digit they start with, and see which card ends up last on the right.
Show solution
Approach: order the cards by their leading digit
  1. The five cards start with the digits 1 (107), 3 (31), 4 (4), 5 (59) and 8 (8).
  2. For the smallest number these leading digits must read in increasing order from left to right, so the cards go 107, 31, 4, 59, 8, giving 107314598.
  3. The card furthest to the right is 8, so the answer is B.
2018 Β· #21 Three different digits A, B, and C are chosen. Then the biggest possible six-digit number is built in which the digit A appears 3 times,...

Three different digits A, B, and C are chosen. Then the biggest possible six-digit number is built in which the digit A appears 3 times, the digit B 2 times, and the digit C 1 time. Which arrangement is definitely not possible for this number?

Show answer
Answer: D — AAABCB
Show hints
Hint 1 of 2
The biggest number puts its six digits in order from largest on the left to smallest on the right, so reading left to right the digits never go back up.
Still stuck? Show hint 2 →
Hint 2 of 2
Watch the two copies of B: if any other letter sits between them, that letter would have to be no bigger than B and no smaller than B at the same time, forcing it to equal B - which is not allowed.
Show solution
Approach: the biggest number lists its digits from largest to smallest, so equal digits must be together
  1. To make the number as big as possible you write its six digits from largest to smallest, so going left to right the digits never increase.
  2. Then the two B's must sit side by side: any letter caught between them would have to be no bigger than B (to its left) yet no smaller than B (to its right), so it would equal B - impossible, since the digits are all different.
  3. In AAABCB the C sits between the two B's, which can never happen.
  4. Every other option keeps the two B's together, so the impossible one is AAABCB.
2020 Β· #26 A three-digit number is called balanced if its middle digit is the average of the other two digits. How many balanced numbers are...

A three-digit number is called balanced if its middle digit is the average of the other two digits. How many balanced numbers are divisible by 18?

Show answer
Answer: C — 6
Show hints
Hint 1 of 2
Divisible by 18 means even and digit-sum divisible by 9; 'balanced' means the middle is the average of the outer two.
Still stuck? Show hint 2 →
Hint 2 of 2
Balanced makes the digit sum three times the middle digit, so the middle digit must be a multiple of 3.
Show solution
Approach: combine the balanced condition with divisibility by 18
  1. Balanced means middle = (first+last)/2, so the digit sum first+middle+last = 3 x middle.
  2. Divisible by 9 needs that sum divisible by 9, so the middle digit is 0, 3, 6 or 9; divisible by 2 needs an even last digit.
  3. Listing the cases gives 234, 432, 468, 630, 666, 864 - exactly 6 numbers.
β˜… MINI-QUIZ

Divisors, GCD/LCM, digit sums

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

2007 Β· #10 For any positive integer n, define [n] to be the sum of the positive factors of n. For example, [6] = 1 + 2 + 3 + 6 = 12. Find [[11]].

For any positive integer n, define [n] to be the sum of the positive factors of n. For example, [6] = 1 + 2 + 3 + 6 = 12. Find [[11]].

Show answer
Answer: D — 28.
Show hints
Hint 1 of 2
Nested brackets mean work inside-out: settle [11] completely before touching the outer bracket. The clue is that 11 is prime — its only factors are 1 and itself.
Still stuck? Show hint 2 →
Hint 2 of 2
Factors come in pairs: list divisors as pairs that multiply to n (1&12, 2&6, 3&4) so you never miss one.
Show solution
Approach: evaluate the inner bracket first, then the outer
  1. Inner first: 11 is prime, so its only factors are 1 and 11 ⇒ [11] = 1 + 11 = 12.
  2. Now [12]. Pair up the divisors so none escape: 1·12, 2·6, 3·4 — that's {1, 2, 3, 4, 6, 12}.
  3. Add them: 1 + 2 + 3 + 4 + 6 + 12 = 28.
  4. Habit worth forming: finding divisors in multiply-to-n pairs guarantees a complete list — the same trick that makes counting factors fast.
2016 Β· #9 Alex has one rope 1Β m long and another 2Β m long. He cuts up both ropes so that all the pieces are of equal length. Which of the...

Alex has one rope 1 m long and another 2 m long. He cuts up both ropes so that all the pieces are of equal length. Which of the following numbers of pieces can he not obtain this way?

Show answer
Answer: B — 8
Show hints
Hint 1 of 2
Every piece must fit a whole number of times into the 1 m rope and into the 2 m rope.
Still stuck? Show hint 2 →
Hint 2 of 2
If each piece is 1/n of a metre, the short rope gives n pieces and the long rope gives 2n, so the total is always a multiple of 3.
Show solution
Approach: the total number of pieces is always a multiple of 3
  1. Equal pieces must divide both ropes exactly, so each piece is 1/n of a metre for some whole number n.
  2. Then the 1 m rope makes n pieces and the 2 m rope makes 2n pieces, for 3n pieces in all — always a multiple of 3.
  3. Among the options 6, 9, 12 and 15 are multiples of 3, but 8 is not, so 8 pieces cannot be obtained.
2011 Β· #21 The five-digit number 24X8Y is divisible by 4, 5 and 9. What is the sum of X and Y?

The five-digit number 24X8Y is divisible by 4, 5 and 9. What is the sum of X and Y?

Show answer
Answer: E — 4
Show hints
Hint 1 of 2
Use the rule for 5 first, then narrow Y with the rule for 4.
Still stuck? Show hint 2 →
Hint 2 of 2
Finally make the digit sum a multiple of 9 to find X.
Show solution
Approach: apply the divisibility rules for 5, 4, then 9
  1. Divisible by 5 means Y is 0 or 5; divisible by 4 needs the last two digits 8Y divisible by 4, forcing Y = 0.
  2. Divisible by 9 means 2+4+X+8+0 = 14+X is a multiple of 9, so X = 4.
  3. Then X + Y = 4 + 0 = 4.
CHAPTER 7

Units digit cycles β€” what big powers end in

THEORY

What's the last digit of 2 to the 100th power? That number has 31 digits — no calculator you own will show it. And yet you can name its final digit in about five seconds, because the last digit of a power doesn't wander. It marches in a tiny loop.

Watch the powers of 2 and keep only the LAST digit:

2ΒΉ=22Β²=42Β³=82⁴=162⁡=322⁢=642⁷=128…2486248cycle 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 strip above is really a loop bent straight. Coil it back up and you get a little wheel — each time you raise the power by one, you take one step clockwise:

The units digit of 2ⁿ rides a 4-spot wheel24862⁴To find 2ⁿ:take n mod 4,step that fararound the wheel.2¹⁰⁰: 100 mod 4 = 0→ the 4th spot = 63, 7, and 8 each ride their own 4-spot wheel; 4 and 9 ride a 2-spot wheel.

So “what does 2ⁿ end in?” becomes “where do you land after n steps around a 4-spot wheel?” — and that's exactly n mod 4. The wheel is why the exponent only matters as its leftover.

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.

🎯 Try it
What is the units digit of 223?
Walkthrough: the cycle for 2 is 2, 4, 8, 6 (period 4). Reduce the exponent: 23 mod 4 = 3, so take the 3rd entry — that's 8. (The trap: 23 mod 4 = 3 lands you on the 3rd spot, not the 23rd; the loop has only four spots.)
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
2009 Β· #2 Which of the following numbers is even?

Which of the following numbers is even?

Show answer
Answer: D — 200 × 9
Show hints
Hint 1 of 2
A number is even when its value ends in an even digit β€” work out each option's value.
Still stuck? Show hint 2 →
Hint 2 of 2
Multiplying anything by an even number gives an even result.
Show solution
Approach: evaluate each option
  1. 2009 is odd; 2+0+0+9 = 11 is odd; 200βˆ’9 = 191 is odd; 200+9 = 209 is odd.
  2. 200 Γ— 9 = 1800, which is even.
  3. So the even one is 200 Γ— 9 β€” answer D.
2009 Β· #1 Which of the following is an even number?

Which of the following is an even number?

Show answer
Answer: D — 200 × 9
Show hints
Hint 1 of 2
An even number is a multiple of 2 - in a product, one factor of 2 is enough.
Still stuck? Show hint 2 →
Hint 2 of 2
Evaluate each choice and pick the one that comes out even.
Show solution
Approach: evaluate each option and test for even
  1. 2009 is odd; 2+0+0+9=11 is odd; 200-9=191 is odd; 200+9=209 is odd.
  2. Only 200x9=1800 is even, since 200 already carries a factor of 2.
  3. So the even number is 200 x 9.
2011 Β· #15 How many digits are in the product 45 Β· 510?

How many digits are in the product 45 · 510?

Show answer
Answer: D — 11 digits.
Show hints
Hint 1 of 2
Don't multiply it out — every 2 pairs with a 5 to make a 10, so rewrite the whole product as a power of 10.
Still stuck? Show hint 2 →
Hint 2 of 2
45 is really 210, which gives you exactly ten 2's to match the ten 5's.
Show solution
Approach: pair every 2 with a 5 to build a power of 10
  1. Rewrite 45 as a power of 2: 45 = (22)5 = 210. Now you have ten 2's and ten 5's.
  2. Each 2 pairs with a 5 to make a 10: 210 · 510 = (2·5)10 = 1010.
  3. 1010 is a 1 followed by ten zeros — that's 11 digits (the 1 plus 10 zeros, not 10).
  4. Worth keeping: a stack of 2's times a stack of 5's always collapses into a power of 10. Watch the off-by-one: 10n has n+1 digits.
1999 Β· #24 When 19992000 is divided by 5, the remainder is

When 19992000 is divided by 5, the remainder is

Show answer
Answer: D — 1.
Show hints
Hint 1 of 2
You'll never compute 1999²⁰⁰⁰ β€” and you don't have to. The remainder when dividing by 5 depends only on the units digit, and the units digit of a power depends only on the units digit of the base. So really you're asking: what does 9²⁰⁰⁰ end in?
Still stuck? Show hint 2 →
Hint 2 of 2
Units digits of powers always fall into a short repeating cycle. List a few powers of 9 and the pattern jumps out; then use whether the exponent is odd or even.
Show solution
Approach: the units digit cycles β€” find where the even exponent lands
  1. Dividing by 5 only cares about the last digit (10, 20, 30, … are all multiples of 5), and the last digit of a power only depends on the base's last digit, 9.
  2. Powers of 9 cycle in their units digit: 9, 81, 729, … β†’ 9, 1, 9, 1, … Odd exponent β†’ ends in 9, even exponent β†’ ends in 1. Since 2000 is even, 1999²⁰⁰⁰ ends in 1.
  3. A number ending in 1 is one more than a multiple of 10 (hence of 5), so the remainder is 1. The transferable idea: for last-digit or mod-5/mod-10 questions, ignore the giant number and ride the short repeating cycle of units digits.
Another way — reduce the base mod 5 first:
  1. Modulo 5, 1999 leaves remainder 4 (since 2000 is a multiple of 5), so 1999²⁰⁰⁰ ≑ 4²⁰⁰⁰ (mod 5).
  2. And 4 ≑ βˆ’1 (mod 5), so 4²⁰⁰⁰ ≑ (βˆ’1)²⁰⁰⁰ = 1 (mod 5).
  3. The remainder is 1. Spotting that the base is βˆ’1 away from a multiple of 5 makes an even power collapse to 1 instantly β€” a clean trick once you've met modular arithmetic.
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
A units digit only depends on the units digits of the factors β€” the tens never reach the ones place. So 12, 22, 32, … all behave like '2', and the long list shrinks to a repeating pattern of 2, 4, 6, 8.
Still stuck? Show hint 2 →
Hint 2 of 2
For a units digit of a huge product, replace each factor by its units digit, group the repeats, and use the fact that units digits of powers cycle.
Show solution
Approach: reduce to units digits, group, then use power cyclicity
  1. Excluding multiples of 10, each block of ten (2,4,6,8 then 12,14,16,18 …) contributes the units digits 2, 4, 6, 8. Their product ends like 2 Γ— 4 Γ— 6 Γ— 8 = 384, i.e. units digit 4.
  2. From 2 to 98 there are 10 such blocks, so the overall units digit is that of 4¹⁰.
  3. Powers of 4 cycle 4, 6, 4, 6, …: 4Β² = 16 ends in 6, and any power of 6 ends in 6, so 4¹⁰ = (4Β²)⁡ ends in 6.
  4. You'll see it again: units digits of nⁿ-style products are tamed by (1) keeping only units digits and (2) exploiting their short repeating cycle β€” never multiply the giant number out.
1994 Β· #25 Find the sum of the digits in the answer to9999…9994 ninesΓ—4444…4494 fourswhere a string of 94 nines is multiplied by a string of 94 fours.

Find the sum of the digits in the answer to

9999…9994 nines×4444…4494 fours

where a string of 94 nines is multiplied by a string of 94 fours.

Show answer
Answer: A — 846.
Show hints
Hint 1 of 2
94 nines is far too big to multiply out β€” but a number THIS regular always hides a pattern. Shrink the problem: try 9Γ—4, then 99Γ—44, then 999Γ—444, and watch what the digit sum does each time you add one more nine.
Still stuck? Show hint 2 →
Hint 2 of 2
This is the 'solve a tiny version first' technique: nail the rule on 1, 2, 3 nines, confirm it's growing by the same amount each step, then leap straight to 94 without ever doing the giant multiplication.
Show solution
Approach: spot the pattern from small cases, then leap to 94
  1. Do the small versions and total the digits: 9Β·4 = 36 (digit sum 9), 99Β·44 = 4356 (sum 18), 999Β·444 = 443556 (sum 27). Each extra nine adds exactly 9 to the digit sum, so the rule is: digit sum = 9 Γ— (number of nines).
  2. With 94 nines, the digit sum is 9 Γ— 94 = 846.
  3. Why it grows by a steady 9: look at 999Β·444 = 443556 β€” it's a run of 4s, then a 3, then a run of 5s, then a 6. Adding one more nine lengthens the 4-run AND the 5-run by one digit each, so the digit sum climbs by 4 + 5 = 9 every time. With 94 nines the product is 93 fours, a 3, 93 fives, a 6, giving 4Β·93 + 3 + 5Β·93 + 6 = 9Β·94 = 846. The reusable move: when a number is too huge to compute, test the smallest cases, check the step between them is constant, then leap to the big case.
  4. Sanity check on the pattern: the all-nines factor is a multiple of 9, so the product is too β€” and a multiple of 9 always has a digit sum that's a multiple of 9. Our 846 = 9 Γ— 94 passes, while the only non-multiple-of-9 choice (1072) can be ruled out on sight. (Several choices ARE multiples of 9, so this test confirms 846 is legal but doesn't pick it alone β€” the small-case rule is what pins down the exact value.)
Another way — rewrite the nines as a round number minus 1:
  1. A string of 94 nines equals 10⁹⁴ βˆ’ 1, so the product is (10⁹⁴ βˆ’ 1)Β·(444…4) = (444…4 with 94 zeros tacked on) βˆ’ (444…4). Subtracting the 94-digit string of 4s from that shifted copy borrows down the line and lands on 93 fours, a 3, 93 fives, a 6 β€” exactly the shape the small cases predicted.
  2. Its digit sum is 4Β·93 + 3 + 5Β·93 + 6 = 372 + 3 + 465 + 6 = 846. Turning 99…9 into 10ⁿ βˆ’ 1 is the standard trick that explains WHY these repeated-digit products come out so regular.
CHAPTER 8

Parity β€” the simplest mod, and the deepest

THEORY

Parity is one word for “is this number even or odd?” The simplest math fact in the universe — but on a contest, 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 — 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.
🎯 Try it
Is 1 + 2 + 3 + 4 + 5 + 6 + 7 odd or even? Type 1 for odd, 0 for even.
Walkthrough: the evens (2, 4, 6) never change parity, so ignore them. Only the ODD terms matter: 1, 3, 5, 7 — that's four of them. Odds pair off two-at-a-time into evens, and four is an even count, so the whole sum is EVEN. Type 0. (Check: the total is 28.) The rule: a sum is odd exactly when it contains an ODD number of odd terms.

Where parity wins on a contest

  • “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.

Whole-number equations — isolate, then list

Some problems hand you an equation like 3x + 5y = 31 and tell you x and y are whole numbers (often counts of things, so they can't be negative). One equation, two unknowns — in regular algebra that has infinitely many answers. But “whole numbers only” changes everything. Now there are only a handful.

Your instinct is to guess pairs at random. Resist it. Here's the clean method.

  1. Isolate one variable. Solve for whichever one is easier: 5y = 31 − 3x, so y = (31 − 3x) ÷ 5.
  2. Walk x up from 0 and keep only the x-values that make the top a clean multiple of 5 (so y comes out whole).
  3. Stop the moment y would go negative.

Walk it: x = 0 → 31÷5, not whole. x = 1 → 28÷5, no. x = 2 → 25÷5 = 5 ✓. x = 3 → 22÷5, no. x = 4 → 19÷5, no. x = 5 → 16÷5, no. x = 6 → 13÷5, no. x = 7 → 10÷5 = 2 ✓. x = 8 → 7÷5, no. x = 9 → 4÷5, no. x = 10 → 3x = 30, only 1 left, not a multiple of 5; x = 11 makes 3x = 33 > 31, so y goes negative — stop.

Two solutions: (x, y) = (2, 5) and (7, 2). Notice the winning x-values jumped by 5 each time (2, then 7). That's not luck: once you find one, the next comes every 5 steps in x (the coefficient of y). Isolate one variable, list the whole-number hits, stop when it goes negative.

(Listing method adapted from Problem Solving via the AMC, Australian Maths Trust.)

Coin and ticket problems — build the equation first

Coin and ticket word problems all hide the same shape: so many things, this much total value. The hard part isn't the math — it's writing the equation.

Watch how a count condition and a value condition combine. You have 12 coins, all dimes (10¢) and quarters (25¢), worth $1.80 in all. How many of each?

Let d = dimes. Then quarters = 12 − d (the count uses up all 12 coins — that's the trick beginners miss). Now the value, in cents:

10d + 25(12 − d) = 180

Expand: 10d + 300 − 25d = 180, so −15d = −120, giving d = 8. So 8 dimes and 4 quarters. Check: 8×10 + 4×25 = 80 + 100 = 180¢ = $1.80 ✓.

The whole game: name ONE unknown, write the other count as “total minus that,” then turn the money into one equation. Count condition fixes the other variable; value condition gives the equation.

(Coin-problem setup adapted from Problem Solving via the AMC, Australian Maths Trust.)

“How many solutions?” — count without listing

Sometimes the question isn't “find x and y” — it's “how MANY whole-number pairs work?” If the count is big, listing every one is slow and you'll lose track. There's a faster way.

How many pairs of positive whole numbers (x, y) satisfy 2x + 7y = 100?

Isolate the variable with the BIGGER coefficient — it grows fastest, so it has the fewest legal values. Solve for y: 7y = 100 − 2x. For y to be a whole number, 100 − 2x must be a multiple of 7.

Find the first hit: x = 1 gives 100 − 2 = 98 = 7×14 ✓, so (1, 14) works. After that, x jumps by 7 each time (the y-coefficient) and y drops by 2: (1,14), (8,12), (15,10), (22,8), (29,6), (36,4), (43,2). The next, x = 50, forces y = 0 — not positive, so stop.

That's 7 solutions — and you found them by stepping, not by checking all 50 values of x. Once the first solution and the step size are known, you can even count by arithmetic: x runs 1, 8, …, 43, which is (43 − 1) ÷ 7 + 1 = 7 values. Find one solution, learn the step, then count — don't grind out the whole list.

(Solution-counting adapted from Problem Solving via the AMC, Australian Maths Trust.)

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 · 2005 #8

Suppose m and n are positive odd integers. Which of the following must also be an odd integer?

A) m + 3n B) 3mn C) 3m2 + 3n2 D) (nm + 3)2 E) 3mn

m and n are positive ODD integers. Which of these MUST be odd: (A) m + 3n, (B) 3mn, (C) 3m² + 3n², (D) (nm + 3)², (E) 3mn?

Don't plug in numbers. Track only odd/even. Since 3 is odd and odd×odd = odd, every piece like 3n, 3m, 3mn is odd.

Now scan for the killer move — odd + odd = even and odd − odd = even. Any choice that adds or subtracts two odds collapses to even:

  • (A) odd + odd = even.
  • (B) odd − odd = even.
  • (C) odd + odd = even.
  • (D) inside is odd + odd = even, and even² = even.
  • (E) 3mn = odd × odd × odd = odd — no addition to spoil it.

Only (E) survives. The answer is 3mn.

Parity isn't only for prime problems. When everything is built from odds, the trap is always a hidden “odd ± odd” turning the whole thing even. The one expression that's a pure product stays odd. You never computed a single value.

Answer: E β€” 3mn.
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
2009 Β· #1 Which of the following is an even number?

Which of the following is an even number?

Show answer
Answer: D — 200 × 9
Show hints
Hint 1 of 2
An even number is a multiple of 2 - in a product, one factor of 2 is enough.
Still stuck? Show hint 2 →
Hint 2 of 2
Evaluate each choice and pick the one that comes out even.
Show solution
Approach: evaluate each option and test for even
  1. 2009 is odd; 2+0+0+9=11 is odd; 200-9=191 is odd; 200+9=209 is odd.
  2. Only 200x9=1800 is even, since 200 already carries a factor of 2.
  3. So the even number is 200 x 9.
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
What does "multiple of 6" really demand of the two dice? Break 6 into its prime pieces — the product needs both of them.
Still stuck? Show hint 2 →
Hint 2 of 2
Technique: 6 = 2 × 3, so the pair needs a factor of 2 (an even die) AND a factor of 3 (a 3 or 6). Test each answer's possible pairs against that single rule.
Show solution
Approach: test which sum has no multiple-of-6 pair
  1. The insight: "multiple of 6" means "has a factor 2 AND a factor 3." So the pair must contain at least one even number AND at least one 3 or 6. That's the only condition — no need to multiply anything out.
  2. Now test each sum. Sum 6 can only be (1,5), (2,4), or (3,3). Check: (1,5) has no even-and-3, (2,4) has no 3 or 6, (3,3) has a 3 but no even number. None qualify — so a sum of 6 is impossible.
  3. Every other choice does have a qualifying pair: 5 = (2,3), 7 = (1,6), 8 = (2,6), 9 = (3,6). Answer: 6. This transfers: to test divisibility by a composite like 6, 12, or 15, split it into prime factors and check each one separately.
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 Β· #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 hints
Hint 1 of 2
85 is odd. Two odds add to an even and two evens add to an even — so an odd total forces one even number and one odd number.
Still stuck? Show hint 2 →
Hint 2 of 2
Among all primes only 2 is even, so one prime is pinned down instantly. No searching required.
Show solution
Approach: an odd sum forces one even addend, and 2 is the only even prime
  1. 85 is odd. Odd + odd = even and even + even = even, so to get an odd sum exactly one prime must be even.
  2. The only even prime is 2, so that prime is 2; the other is 85 − 2 = 83 (prime — check).
  3. Product: 2 × 83 = 166.
  4. Why this transfers: "even prime" almost always means just "2". Watch the parity of a sum and you can often nail one number before doing any real work.
2017 Β· #29 Sarah wants to write a positive whole number onto every tile in the number wall shown, so that every number is equal to the sum of the...

Sarah wants to write a positive whole number onto every tile in the number wall shown, so that every number is equal to the sum of the two numbers on the tiles that are directly below it. What is the maximum number of odd numbers Sarah can write on the tiles?

Figure for Math Kangaroo 2017 Problem 29
Show answer
Answer: D — 10
Show hints
Hint 1 of 2
A tile is the sum of the two below it, so it is odd only when exactly one of those two is odd.
Still stuck? Show hint 2 →
Hint 2 of 2
Arrange the bottom row's parities to keep as many tiles odd as possible.
Show solution
Approach: track parities up the wall
  1. With 15 tiles (rows of 5, 4, 3, 2, 1), each upper tile is odd exactly when the two below it differ in parity.
  2. Searching parity patterns for the bottom row, the most odd tiles achievable across the whole wall is 10.
  3. So the maximum number of odd tiles is 10.
2018 Β· #23 Nick wants to split the numbers 2, 3, 4, 5, 6, 7, 8, 9, 10 into some groups so that the sum of the numbers in each group is the same....

Nick wants to split the numbers 2, 3, 4, 5, 6, 7, 8, 9, 10 into some groups so that the sum of the numbers in each group is the same. What is the biggest number of groups he can make this way?

Show answer
Answer: B — 3
Show hints
Hint 1 of 2
Add 2 through 10 first; each group's sum must divide that total evenly.
Still stuck? Show hint 2 →
Hint 2 of 2
The number 10 must sit in some group, so every group sum is at least 10 - that caps how many groups you can have.
Show solution
Approach: use the total and the largest element to bound the groups
  1. The numbers 2 + 3 + ... + 10 add to 54.
  2. Equal groups means each group's sum divides 54, and since 10 sits in one group every group sum is at least 10.
  3. The only divisor of 54 that is at least 10 and gives more than two groups is 18, which makes 54 / 18 = 3 groups (e.g. {10,8}, {9,7,2}, {6,5,4,3}).
  4. So the most groups is 3.
2020 Β· #29 Sonia writes three consecutive whole numbers, one on each side of a triangle. Then, on each vertex of the triangle, she writes the sum...

Sonia writes three consecutive whole numbers, one on each side of a triangle. Then, on each vertex of the triangle, she writes the sum of the numbers written on the two sides that meet at that vertex, and she multiplies these three vertex numbers, obtaining the product 504. What is the product of the three numbers written on the sides of the triangle?

Show answer
Answer: B — 60
Show hints
Hint 1 of 2
Call the three consecutive numbers n, n+1, n+2; each vertex product is a sum of two of them.
Still stuck? Show hint 2 →
Hint 2 of 2
The vertex sums are 2n+1, 2n+2, 2n+3; set their product to 504 and find n.
Show solution
Approach: set up the vertex products
  1. With sides n, n+1, n+2, the three vertices hold (2n+1), (2n+2), (2n+3), and their product is 504.
  2. Testing, 7 × 8 × 9 = 504, so 2n+1 = 7, giving n = 3 and sides 3, 4, 5.
  3. The product of the side numbers is 3 × 4 × 5 = 60.
  4. The answer is 60, choice B.
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.
🎯 Try it
Today is Tuesday. Counting 100 days forward, how many days PAST Tuesday does it land? (That is, what is 100 reduced mod 7?)
Walkthrough: days run on a 7-cycle, so only 100 mod 7 matters. 100 = 14×7 + 2, so the leftover is 2. Step 2 days past Tuesday and you land on Thursday — but the leftover itself is 2, which is all you needed to compute.

The fencepost trap — counting a range

“How many whole numbers from 4 to 20?” Your instinct says 20 − 4 = 16. Resist it — that’s the classic off-by-one mistake. Subtracting counts the GAPS between numbers, not the numbers themselves.

Think of fence posts and the panels between them. A fence with 5 posts has only 4 panels. Posts > panels, always by one.

5 posts4 panels between them

COUNTING WHOLE NUMBERS IN A RANGE

Inclusive count (both ends counted) = last − first + 1. The +1 is the extra post.

From 4 to 20: 20 − 4 + 1 = 17 numbers. Not 16.

WORKED EXAMPLE — kangaroo-2016-kadett-01

How many natural numbers are STRICTLY between 3.17 and 20.16?

“Strictly between” means the whole numbers bigger than 3.17 and smaller than 20.16. The first is 4 (3 is too small); the last is 20 (21 is too big).

So count 4, 5, 6, …, 20. Use the formula: 20 − 4 + 1 = 17. (Subtracting alone would have given the wrong 16.)

Same trap shows up as cuts on a rope (n cuts make n+1 pieces) and posts on a track. Whenever you count things in a line, ask: am I counting the posts, or the gaps? For an inclusive count, it’s last − first plus one.

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 · 2002 #5

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

A) Monday B) Wednesday C) Friday D) Saturday E) Sunday

Carlos was born on a Saturday. What day of the week is he when he's 706 days old?

Weekdays repeat every 7 days, so any chunk of whole weeks is invisible — it lands you right back on the same day. Strip them out.

Split 706 the easy way: 706 = 700 + 6. And 700 is exactly 100 weeks (700 = 100 × 7), so those 700 days drop you back on Saturday with nothing changed.

Now step the 6 leftover days past Saturday: Sun, Mon, Tue, Wed, Thu, Friday.

So Carlos is 706 days old on a Friday.

For any “what day/spot after N steps” question with a 7-cycle, only the leftover of N after pulling out whole weeks matters. Break N into (multiple of 7) + (small remainder) and walk only the remainder — here, 6 steps instead of 706.

Answer: C β€” Friday.
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
1986 Β· #5 A contest began at noon one day and ended 1000 minutes later. At what time did the contest end?

A contest began at noon one day and ended 1000 minutes later. At what time did the contest end?

Show answer
Answer: D — 4:40 a.m.
Show hints
Hint 1 of 2
1000 loose minutes is hard to add to a clock. What unit would make adding to "noon" easy?
Still stuck? Show hint 2 →
Hint 2 of 2
Trade the minutes in for hours: how many whole hours fit in 1000 minutes, and how many minutes are left over?
Show solution
Approach: convert minutes to hours-and-minutes, then add
  1. Clocks count in hours, so first turn 1000 minutes into hours. Since 60 minutes make an hour, 1000 Γ· 60 = 16 with 40 left over: that's 16 hours 40 minutes.
  2. Add to noon. 16 hours past noon: noon + 12 h = midnight, then + 4 more h = 4:00 a.m.; the leftover 40 minutes makes 4:40 a.m. the next day.
  3. Why split off the 12 first: jumping straight to midnight handles the a.m./p.m. flip cleanly, so you don't accidentally land on 4:40 p.m.
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 3
The cheapest clue to use is the ÷10 one: a leftover of 3 when you divide by 10 simply means N ends in the digit 3. That single fact shrinks the whole list to {13, 23, 33, …, 93}.
Still stuck? Show hint 2 →
Hint 2 of 3
Now apply the ÷9 clue. Handy shortcut: a number's leftover when divided by 9 equals the leftover of its DIGIT SUM — so just look for the candidate whose digits add to something 1-more-than-a-multiple-of-9.
Still stuck? Show hint 3 →
Hint 3 of 3
Find N first; only THEN divide it by 11. Don't try to juggle all three divisors at once — pin down the number, then answer the actual question.
Show solution
Approach: let the easy clue filter the list, then test with the digit-sum trick
  1. "Leftover 3 when divided by 10" means the units digit is 3, so N ∈ {13, 23, 33, 43, 53, 63, 73, 83, 93}.
  2. Digit-sum test for division by 9 (a number and its digit sum leave the same leftover): 13→4, 23→5, …, 73→10 which leaves 1. Only 73 leaves a leftover of 1. So N = 73.
  3. Now answer the real question: 73 = 11 × 6 + 7, so the leftover when divided by 11 is 7.
  4. Why this transfers: when several remainder conditions overlap, start with the one that fixes the most (divide-by-10 fixes a whole digit), then sieve the short list — far faster than algebra.
2024 Β· #22 Daniel wants to cut a rope into 12 equal pieces and marks the places where he has to cut. Mohammed wants to cut the same rope into 16...

Daniel wants to cut a rope into 12 equal pieces and marks the places where he has to cut. Mohammed wants to cut the same rope into 16 equal pieces and marks his cuts as well. Maya finally cuts the rope at all the marked spots. How many pieces does Maya get?

Show answer
Answer: A — 24
Show hints
Hint 1 of 2
Count the marks each boy makes (11 for twelve pieces, 15 for sixteen pieces), but watch for marks that land on the same spot.
Still stuck? Show hint 2 →
Hint 2 of 2
Shared marks happen where the fractions agree; subtract those once, and remember the number of pieces is one more than the number of cuts.
Show solution
Approach: inclusion-exclusion on the cut marks, then add one
  1. Daniel makes 11 marks (at 1/12, 2/12, …, 11/12) and Mohammed makes 15 marks (at 1/16, …, 15/16).
  2. Marks coincide where the positions match, which happens at 1/4, 1/2 and 3/4 β€” that is 3 shared marks.
  3. Distinct cut points: 11 + 15 βˆ’ 3 = 23.
  4. Cutting at 23 points gives 23 + 1 = 24 pieces.
1999 Β· #24 When 19992000 is divided by 5, the remainder is

When 19992000 is divided by 5, the remainder is

Show answer
Answer: D — 1.
Show hints
Hint 1 of 2
You'll never compute 1999²⁰⁰⁰ β€” and you don't have to. The remainder when dividing by 5 depends only on the units digit, and the units digit of a power depends only on the units digit of the base. So really you're asking: what does 9²⁰⁰⁰ end in?
Still stuck? Show hint 2 →
Hint 2 of 2
Units digits of powers always fall into a short repeating cycle. List a few powers of 9 and the pattern jumps out; then use whether the exponent is odd or even.
Show solution
Approach: the units digit cycles β€” find where the even exponent lands
  1. Dividing by 5 only cares about the last digit (10, 20, 30, … are all multiples of 5), and the last digit of a power only depends on the base's last digit, 9.
  2. Powers of 9 cycle in their units digit: 9, 81, 729, … β†’ 9, 1, 9, 1, … Odd exponent β†’ ends in 9, even exponent β†’ ends in 1. Since 2000 is even, 1999²⁰⁰⁰ ends in 1.
  3. A number ending in 1 is one more than a multiple of 10 (hence of 5), so the remainder is 1. The transferable idea: for last-digit or mod-5/mod-10 questions, ignore the giant number and ride the short repeating cycle of units digits.
Another way — reduce the base mod 5 first:
  1. Modulo 5, 1999 leaves remainder 4 (since 2000 is a multiple of 5), so 1999²⁰⁰⁰ ≑ 4²⁰⁰⁰ (mod 5).
  2. And 4 ≑ βˆ’1 (mod 5), so 4²⁰⁰⁰ ≑ (βˆ’1)²⁰⁰⁰ = 1 (mod 5).
  3. The remainder is 1. Spotting that the base is βˆ’1 away from a multiple of 5 makes an even power collapse to 1 instantly β€” a clean trick once you've met modular arithmetic.
2018 Β· #21 How many positive three-digit integers have a remainder of 2 when divided by 6, a remainder of 5 when divided by 9, and a remainder of 7...

How many positive three-digit integers have a remainder of 2 when divided by 6, a remainder of 5 when divided by 9, and a remainder of 7 when divided by 11?

Show answer
Answer: E — 5 integers.
Show hints
Hint 1 of 2
Three separate remainder conditions look like a mess — until you notice each remainder is exactly 4 short of its divisor (2 = 6−4, 5 = 9−4, 7 = 11−4). That shared "4 short" is the whole problem.
Still stuck? Show hint 2 →
Hint 2 of 2
The technique: if x is 4 short of a multiple of 6, of 9, and of 11, then x + 4 is a common multiple of all three — so it's a multiple of their lcm. Three conditions collapse into one.
Show solution
Approach: spot the common shift, then use lcm
  1. Rewrite each condition as "4 short": remainder 2 mod 6 means x + 4 is divisible by 6; remainder 5 mod 9 means x + 4 divisible by 9; remainder 7 mod 11 means x + 4 divisible by 11.
  2. So x + 4 is a multiple of lcm(6, 9, 11) = 2 · 32 · 11 = 198.
  3. Three-digit x means 100 ≤ x ≤ 999, so 104 ≤ x + 4 ≤ 1003. The multiples of 198 there are 198, 396, 594, 792, 990 — 5 values.
  4. You'll see it again: when every remainder is the same fixed amount below its divisor, shift the variable by that amount and the simultaneous system becomes a single lcm divisibility — the cleanest route past full Chinese Remainder Theorem casework.
2011 Β· #27 Seven years ago Eva’s age was a multiple of 8. In eight years it will be a multiple of 7. Eight years ago Raffi’s age was a multiple of...

Seven years ago Eva’s age was a multiple of 8. In eight years it will be a multiple of 7. Eight years ago Raffi’s age was a multiple of 7. In seven years it will be a multiple of 8. Which of the following statements can be true?

Show answer
Answer: A — Raffi is two years older than Eva.
Show hints
Hint 1 of 2
Write each clue as 'age plus or minus something is a multiple of 7 or 8' and combine them.
Still stuck? Show hint 2 →
Hint 2 of 2
Compare the possible ages of Eva and Raffi to read off their age difference.
Show solution
Approach: find the smallest age each set of clues allows, then compare
  1. Eva needs \(E-7\) a multiple of 8 and \(E+8\) a multiple of 7; the smallest realistic age that fits both is \(E=55\) (since \(48\) and \(63\) work).
  2. Raffi needs \(R-8\) a multiple of 7 and \(R+7\) a multiple of 8; the smallest realistic age that fits both is \(R=57\) (since \(49\) and \(64\) work).
  3. With \(E=55\) and \(R=57\), Raffi is exactly 2 years older than Eva, so statement A can be true.
β¬’ FINAL TEST

Stretch test

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

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
Counting cubes is really counting their cube-roots: a cube n3 is in range exactly when n is. So the whole game is finding the smallest and largest allowed n. Look hard at 218 — that exponent 18 is begging to be split as 6×3.
Still stuck? Show hint 2 →
Hint 2 of 2
The technique: take cube roots of the boundaries to turn a range of cubes into a range of integers, then count integers with "last − first + 1." The "+1" on each bound (the +1's in 28+1 and 218+1) only nudges the endpoints — check whether each endpoint is itself a cube.
Show solution
Approach: bracket the cube-root bounds
  1. Upper end: 218 = (26)3 = 643, which is ≤ 218 + 1, so base 64 counts but base 65 (= 653) blows past the limit. Largest base: 64.
  2. Lower end: 28 + 1 = 257. Bracket it between cubes: 63 = 216 < 257 but 73 = 343 ≥ 257, so the smallest cube in range has base 7.
  3. Count the integer bases from 7 to 64 inclusive: 64 − 7 + 1 = 58.
  4. You'll see it again: "how many cubes (or squares) in a range" collapses to "how many integers between the cube roots" — and recognizing a power like 218 as a perfect cube is the move that makes the top bound exact instead of approximate.
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
Translate each clue into a structural fact. Ending in 99 means "add 1" gives a number ending in 00 — and a perfect square ending in 00 forces its square root to be a multiple of 10. That alone cuts the candidates to a handful.
Still stuck? Show hint 2 →
Hint 2 of 2
Now the number is (10k)2 − 1 = (10k − 1)(10k + 1), already factored. "Product of exactly two primes" means both of those factors must themselves be prime — you're hunting twin primes straddling a multiple of 10.
Show solution
Approach: turn the clues into structure: square ends in 00, then seek twin primes
  1. Decode the conditions instead of testing thousands of numbers. "Ends in 99" + 1 = ends in 00, and a square ending in 00 must be (10k)2. So the number is (10k)2 − 1 = (10k − 1)(10k + 1) — a difference of squares, factored for free.
  2. Four-digit size forces 10k ∈ {40, 50, 60, 70, 80, 90, 100}, just 7 cases.
  3. "Product of exactly two primes" now means both 10k − 1 and 10k + 1 are 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 survives, so exactly 1.
  5. Why this transfers: "one less than a perfect square" should instantly trigger the difference-of-squares factoring a2 − 1 = (a−1)(a+1) — turning a vague property into a concrete factorization you can prime-test.
2018 Β· #21 How many positive three-digit integers have a remainder of 2 when divided by 6, a remainder of 5 when divided by 9, and a remainder of 7...

How many positive three-digit integers have a remainder of 2 when divided by 6, a remainder of 5 when divided by 9, and a remainder of 7 when divided by 11?

Show answer
Answer: E — 5 integers.
Show hints
Hint 1 of 2
Three separate remainder conditions look like a mess — until you notice each remainder is exactly 4 short of its divisor (2 = 6−4, 5 = 9−4, 7 = 11−4). That shared "4 short" is the whole problem.
Still stuck? Show hint 2 →
Hint 2 of 2
The technique: if x is 4 short of a multiple of 6, of 9, and of 11, then x + 4 is a common multiple of all three — so it's a multiple of their lcm. Three conditions collapse into one.
Show solution
Approach: spot the common shift, then use lcm
  1. Rewrite each condition as "4 short": remainder 2 mod 6 means x + 4 is divisible by 6; remainder 5 mod 9 means x + 4 divisible by 9; remainder 7 mod 11 means x + 4 divisible by 11.
  2. So x + 4 is a multiple of lcm(6, 9, 11) = 2 · 32 · 11 = 198.
  3. Three-digit x means 100 ≤ x ≤ 999, so 104 ≤ x + 4 ≤ 1003. The multiples of 198 there are 198, 396, 594, 792, 990 — 5 values.
  4. You'll see it again: when every remainder is the same fixed amount below its divisor, shift the variable by that amount and the simultaneous system becomes a single lcm divisibility — the cleanest route past full Chinese Remainder Theorem casework.
2020 Β· #24 Let N be the smallest positive number such that half of N is divisible by 2, one-third of N is divisible by 3, one-quarter of N is...

Let N be the smallest positive number such that half of N is divisible by 2, one-third of N is divisible by 3, one-quarter of N is divisible by 4, one-fifth of N is divisible by 5, one-sixth of N is divisible by 6, one-eighth of N is divisible by 8, and one-ninth of N is divisible by 9. The square root of N is a number of how many digits?

Show answer
Answer: A — 3
Show hints
Hint 1 of 2
'Half of N divisible by 2' means N is a multiple of 4; turn each clue into a divisibility of N.
Still stuck? Show hint 2 →
Hint 2 of 2
Take the least common multiple of all those requirements, then count the digits of its square root.
Show solution
Approach: translate the clues, then take the LCM
  1. The clues say N is a multiple of 4, 9, 16, 25, 36, 64 and 81.
  2. Their least common multiple is N = 129600.
  3. √129600 = 360, which has 3 digits.
  4. The answer is 3, choice A.
2016 Β· #24 The digits 1, 2, 3, 4, and 5 are each used once to write a five-digit number PQRST. The three-digit number PQR is divisible by 4, the...

The digits 1, 2, 3, 4, and 5 are each used once to write a five-digit number PQRST. The three-digit number PQR is divisible by 4, the three-digit number QRS is divisible by 5, and the three-digit number RST is divisible by 3. What is P?

Show answer
Answer: A — P = 1.
Show hints
Hint 1 of 3
Attack the TIGHTEST rule first. Divisible-by-5 is the strictest: the last digit must be 0 or 5, and the only one of {1,2,3,4,5} available is 5 — so QRS divisible by 5 instantly forces S = 5. One clue, one digit pinned.
Still stuck? Show hint 2 →
Hint 2 of 3
Next-tightest: PQR divisible by 4 means its last two digits QR form a multiple of 4. With 5 used up, QR is a two-digit number from {1, 2, 3, 4} that's a multiple of 4 — only 12, 24, 32 qualify. Just three cases left.
Still stuck? Show hint 3 →
Hint 3 of 3
Finish with the gentlest rule (divisible by 3 = digit sum divisible by 3) to test the survivors. Notice R is shared by all three numbers, so it's heavily constrained — track it.
Show solution
Approach: apply the divisibility rules from most-restrictive to least, then test the few survivors
  1. Divisible-by-5 is strictest: QRS ends in S, which must be 0 or 5, so S = 5.
  2. Divisible-by-4: QR (the last two digits of PQR) must be a multiple of 4 built from {1, 2, 3, 4} — only 12, 24, 32 work. Three cases.
  3. QR = 12: leftovers {3, 4} for P, T; RST = 25T has digit sum 7 + T, and T ∈ {3, 4} gives 10 or 11 — not divisible by 3. Out.
  4. QR = 24: leftovers {1, 3}; RST = 45T has digit sum 9 + T, and T = 3 gives 12, divisible by 3. ✓ That forces P = 1, so PQRST = 12435 and P = 1.
  5. QR = 32: leftovers {1, 4}; RST = 25T sum 7 + T with T ∈ {1, 4} gives 8 or 11 — not divisible by 3. Out. Only one solution survives.
  6. Why this transfers: for digit puzzles with several divisibility rules, always resolve the most restrictive constraint first (it pins digits outright), which shrinks the casework before the looser rules ever come up.
πŸš€ STRETCH

Stretch practice — beyond AMC 8

24 bonus problems on Number Theory. These are typed-answer (no multiple choice) and tilt harder — closer to early AMC 10. Try the ones that look fun.

Stretch Β· #1 Find every pair of different positive whole numbers \(a\) and \(b\) (with \(a>b\)) so that \(\dfrac{1}{a}+\dfrac{1}{b}=\dfrac{1}{9}\).
Find every pair of different positive whole numbers \(a\) and \(b\) (with \(a>b\)) so that \(\dfrac{1}{a}+\dfrac{1}{b}=\dfrac{1}{9}\).
Show answer
Answer: (a,b)=(90,10) and (36,12)
Show hints
Hint 1 of 4
Think about sizes first. If \(b\) were \(9\) or smaller, then \(\tfrac1b\) would already be \(\tfrac19\) or bigger, leaving nothing for \(\tfrac1a\). So both \(a\) and \(b\) must be bigger than \(9\).
Still stuck? Show hint 2 →
Hint 2 of 4
Clear the fractions. Multiply everything by \(9ab\) to get \(9b+9a=ab\). Rearrange to \(ab-9a-9b=0\).
Still stuck? Show hint 3 →
Hint 3 of 4
Here is the classic trick: add \(81\) to both sides so the left side factors. You get \(ab-9a-9b+81=81\), which is \((a-9)(b-9)=81\).
Show solution
Approach: Add 81 and factor (Simon's Favorite Factoring), then search factor pairs
  1. Both numbers must be bigger than 9: if \(b\le 9\) then \(\tfrac1b\ge\tfrac19\), which already uses up all of \(\tfrac19\), leaving nothing for \(\tfrac1a\). So \(a>b>9\).
  2. Clear fractions by multiplying \(\tfrac1a+\tfrac1b=\tfrac19\) by \(9ab\): \(9b+9a=ab\), so \(ab-9a-9b=0\).
  3. Add \(81\) to both sides so the left factors: \(ab-9a-9b+81=81\), i.e. \((a-9)(b-9)=81\).
  4. List factor pairs of \(81\) with the bigger factor going to \(a\): \(a-9=81, b-9=1\Rightarrow a=90, b=10\); and \(a-9=27, b-9=3\Rightarrow a=36, b=12\). (The split \(9\times9\) gives \(a=b=18\), but we need \(a>b\), so skip it.)
  5. Check: \(\tfrac{1}{90}+\tfrac{1}{10}=\tfrac{1}{90}+\tfrac{9}{90}=\tfrac{10}{90}=\tfrac19\), and \(\tfrac{1}{36}+\tfrac{1}{12}=\tfrac{1}{36}+\tfrac{3}{36}=\tfrac{4}{36}=\tfrac19\). So the pairs are \((a,b)=(90,10)\) and \((36,12)\).
Stretch Β· #4 In the Unlucky Lottery, every prize is a power of 13 dollars β€” that is \(1\), \(13\), \(169\), \(2{,}197\) dollars, and so on. The total...
In the Unlucky Lottery, every prize is a power of 13 dollars β€” that is \(1\), \(13\), \(169\), \(2{,}197\) dollars, and so on. The total prize money handed out is exactly \(1{,}000{,}000\) dollars. What is the smallest possible number of prizes?
Show answer
Answer: 16 prizes
Show hints
Hint 1 of 4
To use as few prizes as possible, hand out the biggest prizes you can first. List the powers of 13 that are below a million.
Still stuck? Show hint 2 →
Hint 2 of 4
The powers are \(1\), \(13\), \(169\), \(2{,}197\), \(28{,}561\), and \(371{,}293\) dollars. Start by taking as many \(371{,}293\) prizes as fit, then move down to the next size.
Still stuck? Show hint 3 →
Hint 3 of 4
Keep subtracting and moving to the next-smaller power. Add up how many prizes you used in total.
Show solution
Approach: Greedy largest-first, which is exactly base-13 expansion
  1. To use the fewest prizes, give out the largest prizes first. The powers of 13 up to a million are \(1\), \(13\), \(169\), \(2{,}197\), \(28{,}561\), \(371{,}293\) dollars.
  2. Two \(371{,}293\) prizes use \(742{,}586\), leaving \(257{,}414\). Nine \(28{,}561\) prizes use \(257{,}049\), leaving \(365\). Zero \(2{,}197\) prizes (too big for \(365\)).
  3. Two \(169\) prizes use \(338\), leaving \(27\). Two \(13\) prizes use \(26\), leaving \(1\). One \(1\) prize finishes it.
  4. Total prizes: \(2+9+0+2+2+1=16\).
  5. Shortcut: this is exactly writing \(1{,}000{,}000\) in base thirteen, namely \(290221_{13}\); the digit sum \(2+9+0+2+2+1=16\) is the minimum number of prizes.
Stretch Β· #5 A hallway has \(100\) lockers, numbered \(1\) to \(100\), all closed. Student \(1\) opens every locker. Student \(2\) changes (opens if...
A hallway has \(100\) lockers, numbered \(1\) to \(100\), all closed. Student \(1\) opens every locker. Student \(2\) changes (opens if closed, closes if open) every \(2\)nd locker: \(2, 4, 6, \dots\). Student \(3\) changes every \(3\)rd locker: \(3, 6, 9, \dots\). This continues through student \(100\). After all \(100\) students go by, how many lockers are OPEN?
Show answer
Answer: 10 lockers (the perfect squares)
Show hints
Hint 1 of 4
Pick one locker, say number \(12\), and figure out exactly which students touch it. A student numbered \(n\) touches locker \(12\) only if \(n\) divides \(12\).
Still stuck? Show hint 2 →
Hint 2 of 4
So locker \(m\) gets touched once for each divisor of \(m\). A locker ends OPEN if it was touched an ODD number of times. So the question becomes: which numbers have an odd number of divisors?
Still stuck? Show hint 3 →
Hint 3 of 4
Divisors usually come in pairs. For \(12\): \((1, 12), (2, 6), (3, 4)\) β€” that is \(6\) divisors, an even number, so locker \(12\) ends closed. When does a divisor get paired with ITSELF?
Show solution
Approach: Count divisors; perfect squares have an odd number of divisors
  1. Focus on one locker, number \(m\). Student \(n\) touches it exactly when \(n\) divides \(m\). So locker \(m\) gets touched once for every divisor of \(m\), and it ends OPEN when the number of divisors is ODD.
  2. Divisors come in pairs \((d, m/d)\). For example \(12\) has the pairs \((1,12), (2,6), (3,4)\) β€” six divisors, an even number, so locker \(12\) ends closed.
  3. The only way to get an ODD count is when one divisor pairs with itself, meaning \(d = m/d\), so \(m = d^2\). For example \(9\) has divisors \(1, 3, 9\): the pair \((3,3)\) is just one number, giving the odd count \(3\).
  4. So the lockers that stay open are exactly the perfect squares \(1, 4, 9, 16, 25, 36, 49, 64, 81, 100\) β€” ten lockers.
Stretch Β· #11 Look at these sums: \(1 = 1\), \(1+3 = 4\), \(1+3+5 = 9\), \(1+3+5+7 = 16\). Adding up the first \(n\) odd numbers always gives a...
Look at these sums: \(1 = 1\), \(1+3 = 4\), \(1+3+5 = 9\), \(1+3+5+7 = 16\). Adding up the first \(n\) odd numbers always gives a perfect square. What is the sum of the first \(10\) odd numbers?
Odd numbers as square borders1+3+5+7= 1 4 9 16
Show answer
Answer: 100
Show hints
Hint 1 of 4
First just look at the answers: \(1, 4, 9, 16, 25, \dots\) What kind of numbers are these?
Still stuck? Show hint 2 →
Hint 2 of 4
Draw each sum as dots arranged in a square. Start with \(1\) dot. How do you grow the square to the next size?
Still stuck? Show hint 3 →
Hint 3 of 4
To turn a \(k \times k\) square into a \((k+1) \times (k+1)\) square, you add an L-shaped border: \(k\) dots down the new right side, \(k\) dots along the new bottom, and \(1\) dot in the corner.
Show solution
Approach: Picture proof β€” each odd number is an L-shaped square border
  1. The answers \(1, 4, 9, 16, 25, \dots\) are the perfect squares \(1^2, 2^2, 3^2, 4^2, \dots\)
  2. Build the sum as a square of dots. To grow a \(k \times k\) square into the next square, add an L-shaped border: a column of \(k\) dots, a row of \(k\) dots, and \(1\) corner dot.
  3. That border has \(k + k + 1 = 2k + 1\) dots β€” exactly the next odd number. So \(1 + 3 + 5 + \dots + (2n-1) = n^2\).
  4. Adding the first \(10\) odd numbers therefore gives \(10^2 = 100\).
Stretch Β· #13 Find the sum of all whole numbers from 1 to 300 that are divisible by neither 8 nor 6.
Find the sum of all whole numbers from 1 to 300 that are divisible by neither 8 nor 6.
Show answer
Answer: 33,748
Show hints
Hint 1 of 4
Start with the sum of ALL numbers from 1 to 300, then subtract the ones you don't want. Remember \(1 + 2 + \cdots + n = \tfrac{n(n+1)}{2}\).
Still stuck? Show hint 2 →
Hint 2 of 4
Subtract the sum of all multiples of 8, and the sum of all multiples of 6. Each is a common factor times a smaller triangular sum.
Still stuck? Show hint 3 →
Hint 3 of 4
Careful: numbers divisible by BOTH 8 and 6 got subtracted twice. Those are multiples of \(\text{lcm}(8,6) = 24\). Add their sum back once.
Show solution
Approach: Inclusion-exclusion on multiples of 8 and 6
  1. All numbers 1 to 300: \(\tfrac{300 \times 301}{2} = 45{,}150\).
  2. Multiples of 8 (\(8 \times 1\) to \(8 \times 37\)): \(8 \times \tfrac{37 \times 38}{2} = 8 \times 703 = 5{,}624\). Multiples of 6 (\(6 \times 1\) to \(6 \times 50\)): \(6 \times \tfrac{50 \times 51}{2} = 6 \times 1275 = 7{,}650\).
  3. Overlap = multiples of \(\text{lcm}(8,6) = 24\) (\(24 \times 1\) to \(24 \times 12\)): \(24 \times \tfrac{12 \times 13}{2} = 24 \times 78 = 1{,}872\). So multiples of 8 OR 6 sum to \(5{,}624 + 7{,}650 - 1{,}872 = 11{,}402\).
  4. Numbers divisible by neither: \(45{,}150 - 11{,}402 = 33{,}748\).
Stretch Β· #14 Start adding \(1 + 2 + 3 + \cdots\), keeping a running total, until the total is a three-digit number with all three digits the same...
Start adding \(1 + 2 + 3 + \cdots\), keeping a running total, until the total is a three-digit number with all three digits the same (like 111, 222, ..., 999). How many numbers do you add?
Show answer
Answer: 36 numbers (the total is 666)
Show hints
Hint 1 of 4
The running total after adding up to \(n\) is \(\tfrac{n(n+1)}{2}\). It has to be at most 999, so \(n\) can't be too big.
Still stuck? Show hint 2 →
Hint 2 of 4
A number 'xxx' (all digits equal) is \(x \times 111\), and \(111 = 3 \times 37\).
Still stuck? Show hint 3 →
Hint 3 of 4
So you need \(\tfrac{n(n+1)}{2}\) to be a multiple of 111, meaning \(n(n+1)\) is a multiple of \(2 \times 3 \times 37\). The prime 37 must divide \(n\) or \(n+1\).
Show solution
Approach: Triangular number must be a repdigit multiple of 111
  1. The running total after \(n\) numbers is \(S = \tfrac{n(n+1)}{2} \le 999\). Since \(\tfrac{44 \times 45}{2} = 990\) and \(\tfrac{45 \times 46}{2} = 1035\), we need \(n \le 44\).
  2. A repdigit 'xxx' equals \(x \times 111 = x \times 3 \times 37\), so \(n(n+1) = 2 \times 3 \times 37 \times x\). The prime 37 must divide \(n\) or \(n+1\), and with \(n \le 44\) the only options are \(n = 37\) or \(n = 36\).
  3. \(n = 37\): \(37 \times 38 = 1406\), not divisible by 3 (digit sum 11), so no. \(n = 36\): \(36 \times 37 = 1332 = 222 \times 6\), so the total is \(666\).
  4. Check: \(1 + 2 + \cdots + 36 = \tfrac{36 \times 37}{2} = 666\). So you add 36 numbers.
Stretch Β· #15 Find the smallest whole number \(n\) that leaves a remainder of \(1\) when you divide it by each of \(2, 3, 4, 5, 6, 7, 8, 9\).
Find the smallest whole number \(n\) that leaves a remainder of \(1\) when you divide it by each of \(2, 3, 4, 5, 6, 7, 8, 9\).
Show answer
Answer: 2521
Show hints
Hint 1 of 4
If \(n\) leaves remainder \(1\) for all those divisors, what can you say about \(n - 1\)? It must divide evenly by all of them.
Still stuck? Show hint 2 →
Hint 2 of 4
So \(n - 1\) is a common multiple of \(2, 3, 4, 5, 6, 7, 8, 9\). The smallest such number is their least common multiple (LCM).
Still stuck? Show hint 3 →
Hint 3 of 4
Many of these are 'covered' by others. If a number is divisible by \(8\), it's automatically divisible by \(4\) and \(2\). If divisible by \(9\), it's divisible by \(3\). The numbers you really need are \(5, 7, 8, 9\).
Show solution
Approach: Reduce to an LCM by looking at n minus 1
  1. If \(n\) leaves remainder \(1\) when divided by each of \(2\) through \(9\), then \(n - 1\) divides evenly by all of them. So \(n - 1\) is their least common multiple.
  2. Many divisors are redundant: divisibility by \(8\) covers \(4\) and \(2\); by \(9\) covers \(3\); by \(2\) and \(3\) covers \(6\).
  3. The ones that really matter are \(5, 7, 8, 9\): \(\text{LCM} = 5 \times 7 \times 8 \times 9 = 2520\).
  4. So \(n - 1 = 2520\), giving \(n = 2521\).
Stretch Β· #15 Find the digit-sum of every number from 1 to 999, then add all those digit-sums together. (The digit-sum of 254 is \(2 + 5 + 4 = 11\).)...
Find the digit-sum of every number from 1 to 999, then add all those digit-sums together. (The digit-sum of 254 is \(2 + 5 + 4 = 11\).) What is the grand total?
Show answer
Answer: 13,500
Show hints
Hint 1 of 4
Don't add number by number. Count how many times each digit 1, 2, ..., 9 appears in total across 1 to 999. (Zeros add nothing.)
Still stuck? Show hint 2 →
Hint 2 of 4
By symmetry, every nonzero digit appears the exact same number of times. So just count how often, say, the digit 3 shows up.
Still stuck? Show hint 3 →
Hint 3 of 4
Count the digit 3 in the ones place, the tens place, and the hundreds place separately. In each place it appears 100 times.
Show solution
Approach: Count digit appearances by symmetry
  1. Adding digit-sums is the same as counting how often each digit appears, weighted by its value. Zeros add nothing, so only digits 1 through 9 matter, and by symmetry each appears equally often.
  2. Count the digit 3 across 1 to 999 (think 000 to 999, three places): ones place 100 times, tens place 100 times, hundreds place 100 times — so 300 times total.
  3. Every nonzero digit likewise appears 300 times, so total \(= 300 (1 + 2 + \cdots + 9) = 300 \times 45 = 13{,}500\).
  4. The grand total is 13,500.
Stretch Β· #17 In a leap year, January has \(31\) days, February \(29\), March \(31\). Using the fact that a week repeats every \(7\) days, January 1...
In a leap year, January has \(31\) days, February \(29\), March \(31\). Using the fact that a week repeats every \(7\) days, January 1 and April 1 fall on the same weekday because the number of days from January 1 to April 1 is a multiple of \(7\). How many days is that?
Show answer
Answer: 91 days (= 7 x 13)
Show hints
Hint 1 of 4
Two dates land on the same weekday when the number of days between them is a multiple of \(7\). So count the days from January 1 to April 1.
Still stuck? Show hint 2 →
Hint 2 of 4
The days from January 1 to April 1 equal the lengths of January, February, and March added together.
Still stuck? Show hint 3 →
Hint 3 of 4
In a leap year, January has \(31\) days, February has \(29\), March has \(31\). Add them up.
Show solution
Approach: Count days, then check divisibility by 7
  1. Two dates fall on the same weekday exactly when the number of days between them divides evenly by \(7\), since the weekday pattern repeats every \(7\) days.
  2. From January 1 to April 1 the days you pass through are all of January, February, and March: \(31 + 29 + 31 = 91\) days.
  3. Divide by \(7\): \(91 = 7 \times 13\), an exact multiple with no remainder. So April 1 lands on the same weekday as January 1.
  4. Bonus: April 1 to July 1 is \(30 + 31 + 30 = 91\) days too, so July 1 also matches β€” that is why January, April, and July all start on the same weekday in a leap year.
Stretch Β· #18 Pick any 7 numbers from \(1, 2, 3, \dots, 12\). Show that two of them differ by exactly 6.
Pick any 7 numbers from \(1, 2, 3, \dots, 12\). Show that two of them differ by exactly 6.
Show answer
Answer: two of them differ by 6
Show hints
Hint 1 of 4
You want two numbers that differ by 6. Could you sort the numbers 1 to 12 into groups so that 'same group' automatically means 'differ by 6'?
Still stuck? Show hint 2 →
Hint 2 of 4
Pair the numbers so each pair differs by 6: \(\{1,7\}, \{2,8\}, \{3,9\}, \{4,10\}, \{5,11\}, \{6,12\}\). How many pairs is that, and do they use up all 12 numbers?
Still stuck? Show hint 3 →
Hint 3 of 4
There are 6 pairs covering all 12 numbers β€” your 6 boxes. You're picking 7 numbers.
Show solution
Approach: Pigeonhole β€” pair the numbers into 6 difference-6 boxes
  1. Split \(1, 2, \dots, 12\) into pairs that differ by 6: \(\{1,7\}, \{2,8\}, \{3,9\}, \{4,10\}, \{5,11\}, \{6,12\}\).
  2. That's 6 pairs, and together they use every number from 1 to 12. Make these 6 pairs the boxes.
  3. Pick your 7 numbers and drop them into the boxes. Since \(7 > 6\), two of them land in the same pair.
  4. The two numbers in a pair differ by exactly \(6\).
Stretch Β· #19 The sum of any \(5\) numbers in a row (like \(8, 9, 10, 11, 12\)) is always divisible by \(5\), because it equals \(5\) times the middle...
The sum of any \(5\) numbers in a row (like \(8, 9, 10, 11, 12\)) is always divisible by \(5\), because it equals \(5\) times the middle number. What is the sum \(8 + 9 + 10 + 11 + 12\)?
Show answer
Answer: 50 (= 5 x 10)
Show hints
Hint 1 of 4
For \(5\) numbers in a row, there is a middle number. How does each number compare to the middle one?
Still stuck? Show hint 2 →
Hint 2 of 4
Pair up the numbers around the middle: the one just below and the one just above add to twice the middle. What does the whole sum equal in terms of the middle number?
Still stuck? Show hint 3 →
Hint 3 of 4
If the sum equals \(5\) times the middle number, it's automatically divisible by \(5\). The middle of \(8, 9, 10, 11, 12\) is \(10\).
Show solution
Approach: Pair around the middle term
  1. Take \(5\) consecutive numbers and call the middle one \(m\): they are \(m-2, m-1, m, m+1, m+2\).
  2. Add them: the \(-2\) and \(+2\) cancel, the \(-1\) and \(+1\) cancel, leaving \(5m\) β€” five times a whole number, so always divisible by \(5\).
  3. For \(8, 9, 10, 11, 12\) the middle is \(m = 10\), so the sum is \(5 \times 10 = 50\).
  4. (Contrast: \(4\) in a row, like \(1 + 2 + 3 + 4 = 10\), has no single middle and \(10\) is not divisible by \(4\).)
Stretch Β· #21 The formula \(n^2 + n + 41\) gives a prime for \(n = 1, 2, 3, \dots, 39\). But it can't give primes forever. Find the SMALLEST positive...
The formula \(n^2 + n + 41\) gives a prime for \(n = 1, 2, 3, \dots, 39\). But it can't give primes forever. Find the SMALLEST positive value of \(n\) that makes \(n^2 + n + 41\) NOT prime.
Show answer
Answer: n = 40 (gives 1681 = 41 squared)
Show hints
Hint 1 of 4
A formula can spit out primes for a long time and still fail eventually. Look for an \(n\) that shares a factor with the \(41\).
Still stuck? Show hint 2 →
Hint 2 of 4
What if you choose \(n\) so that the pieces share the factor \(41\)?
Still stuck? Show hint 3 →
Hint 3 of 4
Try \(n = 41\): then \(n^2 = 41 \times 41\), \(n = 41\), and the last term is \(41\). Factor out the \(41\). But check smaller values too.
Show solution
Approach: Test cases and factor to expose a composite value
  1. Look for an \(n\) where the value factors. Try \(n = 40\): \(40^2 + 40 + 41 = 1600 + 40 + 41 = 1681 = 41 \times 41 = 41^2\) β€” a perfect square, so not prime.
  2. Check that nothing smaller fails: for \(n = 1\) through \(39\) the formula is known to give primes, so \(40\) is the smallest failure.
  3. Why it must eventually fail: at \(n = 41\), \(41^2 + 41 + 41 = 41(41 + 1 + 1) = 41 \times 43\), clearly composite.
  4. So the smallest \(n\) making it composite is \(40\).
Stretch Β· #3 A fraction is 'reducible' if its top and bottom share a common factor bigger than \(1\) (so it can be simplified). What is the smallest...
A fraction is 'reducible' if its top and bottom share a common factor bigger than \(1\) (so it can be simplified). What is the smallest positive whole number \(n\) that makes \(\dfrac{n-12}{5n+23}\) a reducible fraction (and not equal to \(0\))?
Show answer
Answer: n=95
Show hints
Hint 1 of 4
A fraction reduces exactly when its flip reduces (same common factor on top and bottom). The flip \(\dfrac{5n+23}{n-12}\) is easier to study.
Still stuck? Show hint 2 →
Hint 2 of 4
Do the division: how many times does \(n-12\) go into \(5n+23\)? Five times \((n-12)\) is \(5n-60\), and \(5n+23-(5n-60)=83\). So \(\dfrac{5n+23}{n-12}=5+\dfrac{83}{n-12}\).
Still stuck? Show hint 3 →
Hint 3 of 4
So the only common factor that \(n-12\) can share with the top comes from the number \(83\). Since \(83\) is a prime number, \(n-12\) must be a multiple of \(83\).
Show solution
Approach: Flip the fraction, divide out the remainder, use that 83 is prime
  1. A fraction reduces exactly when its flip reduces, so study \(\dfrac{5n+23}{n-12}\).
  2. Divide: \(5\) copies of \((n-12)\) make \(5n-60\), and the leftover is \((5n+23)-(5n-60)=83\). So \(\dfrac{5n+23}{n-12}=5+\dfrac{83}{n-12}\).
  3. The fraction reduces exactly when \(n-12\) and \(83\) share a common factor bigger than \(1\). But \(83\) is prime, so its only factor bigger than \(1\) is \(83\) itself, meaning \(n-12\) must be a multiple of \(83\).
  4. The smallest positive \(n\) comes from \(n-12=83\), so \(n=95\).
Stretch Β· #4 People stand in a circle, numbered \(1, 2, 3, \dots, N\) clockwise. Person \(1\) says 'one' and stays. Person \(2\) says 'two' and steps...
People stand in a circle, numbered \(1, 2, 3, \dots, N\) clockwise. Person \(1\) says 'one' and stays. Person \(2\) says 'two' and steps OUT. Person \(3\) stays, person \(4\) steps out, and so on around and around: every other person leaves. The counting keeps going (it does NOT restart) until one person is left. Who survives when \(N = 100\)?
Show answer
Answer: Person 73
Show hints
Hint 1 of 4
One hundred is too many to act out. Solve smaller versions first! Make a table: for \(N = 1, 2, 3, 4, 5, 6, 7, 8\), who survives?
Still stuck? Show hint 2 →
Hint 2 of 4
Notice the rows where the survivor is person \(1\). They happen at \(N = 1, 2, 4, 8, 16, \dots\) β€” the powers of \(2\). What pattern do you see between those points?
Still stuck? Show hint 3 →
Hint 3 of 4
Write \(N\) as (a power of \(2\)) plus a leftover: \(N = 2^k + L\), where \(2^k\) is the biggest power of \(2\) that is not bigger than \(N\). The survivor turns out to be a simple formula in \(L\).
Show solution
Approach: Solve a simpler problem, find the pattern, then apply the formula
  1. Build a table of survivors for small \(N\):
    N12345678
    survivor11313571
  2. The survivor is person \(1\) exactly when \(N\) is a power of \(2\) (\(1, 2, 4, 8, 16, \dots\)). Between powers of \(2\), the survivor jumps up by \(2\) each time (\(1, 3, 5, 7, \dots\)) and then resets to \(1\).
  3. So write \(N = 2^k + L\), where \(2^k\) is the biggest power of \(2\) that fits inside \(N\) and \(L\) is the leftover. The survivor's number is \(2L + 1\).
  4. For \(N = 100\): the biggest power of \(2\) that is \(\le 100\) is \(64\), so \(L = 100 - 64 = 36\) and the survivor is \(2(36) + 1 = 73\).
Stretch Β· #5 A hallway has 100 lockers, all closed, and 100 students. Student 1 walks by and opens every locker. Student 2 toggles every 2nd locker...
A hallway has 100 lockers, all closed, and 100 students. Student 1 walks by and opens every locker. Student 2 toggles every 2nd locker (2, 4, 6, ...), closing each one. Student 3 toggles every 3rd locker (3, 6, 9, ...) β€” opening it if closed, closing it if open. In general, Student \(k\) toggles every \(k\)-th locker. After all 100 students have gone by, how many lockers are still open?
Show answer
Answer: 10 lockers (the perfect squares)
Show hints
Hint 1 of 4
One hundred lockers is too many to track in your head. Reduce! Just do the first 10 or 12 lockers by hand. Mark each locker O (open) or C (closed) after each student passes. Which ones end up open?
Still stuck? Show hint 2 →
Hint 2 of 4
Focus on one locker, say locker 12. Which students touch it? Only the ones whose number divides 12 evenly: students 1, 2, 3, 4, 6, 12. So a locker gets toggled once for each of its divisors (factors).
Still stuck? Show hint 3 →
Hint 3 of 4
A locker starts closed. Each toggle flips it. So it ends OPEN only if it was toggled an ODD number of times β€” that is, only if its locker number has an ODD number of divisors.
Show solution
Approach: Reduce and expand β€” a locker ends open iff it has an odd number of divisors (perfect squares)
  1. Reduce the problem β€” trace just the first 12 lockers by hand, marking open (O) or closed (C). The lockers left open are 1, 4, 9: the perfect squares.
  2. Who touches a locker? Student \(k\) toggles locker \(n\) exactly when \(k\) divides \(n\). So locker \(n\) is toggled once for each of its divisors. Locker 12 has divisors 1, 2, 3, 4, 6, 12 β€” six toggles.
  3. Every locker starts closed and each toggle flips it, so a locker ends OPEN only if it is flipped an ODD number of times β€” its number must have an ODD number of divisors.
  4. Divisors normally come in pairs \((d, n/d)\), giving an even count. The count is odd only when one divisor pairs with itself, \(d \times d = n\) β€” exactly when \(n\) is a perfect square (e.g. 16 has divisors 1, 2, 4, 8, 16, an odd 5, because \(4 \times 4 = 16\)).
  5. The open lockers are the perfect squares up to 100: \(1, 4, 9, 16, 25, 36, 49, 64, 81, 100\) β€” that is \(1^2\) through \(10^2\), a total of \(10\) open lockers. (In the original 1000-locker version the answer is the perfect squares up to \(31^2 = 961\), so 31 open lockers.)
Stretch Β· #5 Pick any 27 different odd numbers, each less than 100. Show that two of them must add up to 102.
Pick any 27 different odd numbers, each less than 100. Show that two of them must add up to 102.
Show answer
Answer: two of them sum to 102
Show hints
Hint 1 of 4
First, how many odd numbers are below 100? They are \(1, 3, 5, \dots, 99\).
Still stuck? Show hint 2 →
Hint 2 of 4
Pair them up so each pair adds to 102: \(\{3,99\}, \{5,97\}, \dots, \{49,53\}\). Which numbers are left over with no partner?
Still stuck? Show hint 3 →
Hint 3 of 4
The leftovers are 1 (its partner 101 is too big) and 51 (its partner would be 51 again). Put those two alone in their own boxes. Count all the boxes.
Show solution
Approach: Pigeonhole β€” group odds below 100 into pairs summing to 102
  1. The odd numbers below 100 are \(1, 3, 5, \dots, 99\) β€” that's 50 numbers.
  2. Group them into boxes whose two numbers add to 102: \(\{3,99\}, \{5,97\}, \{7,95\}, \dots, \{49,53\}\). That's 24 pairs.
  3. Two numbers have no partner: 1 (since \(102-1=101\) isn't under 100) and 51 (since \(102-51=51\) is itself). Give each its own box. Total boxes: \(24 + 2 = 26\).
  4. Choose your 27 numbers and drop them in. Since \(27 > 26\), some box gets 2 numbers. A singleton box holds only 1, so the doubled box must be one of the 24 pairs β€” and that pair sums to \(102\).
Stretch Β· #6 Every entry below is a way to write the SAME number, but each in a different counting base, and the bases go DOWN by one each step. Find...
Every entry below is a way to write the SAME number, but each in a different counting base, and the bases go DOWN by one each step. Find the rule and fill in the missing entry: \[10,\ 11,\ 12,\ 13,\ 14,\ \underline{\ \ },\ 100.\]
Show answer
Answer: 21 (the number 9 written in base 4)
Show hints
Hint 1 of 4
Don't read these as ordinary base-ten numbers. Try the idea that every entry stands for the SAME number, just written in a different base.
Still stuck? Show hint 2 →
Hint 2 of 4
Remember what a numeral means: '12' in base \(b\) means \(1 \times b + 2\). And '100' in base \(b\) means \(b \times b\).
Still stuck? Show hint 3 →
Hint 3 of 4
The last entry is \(100\). If \(100\) in some base equals our secret number, then the number is a perfect square. Try: the secret number is \(9\), and \(100\) is written in base \(3\) (since \(3 \times 3 = 9\)).
Show solution
Approach: Adopt a different point of view β€” every entry is one fixed number in shrinking bases
  1. Change your point of view: every entry is the SAME number, \(9\), just written in a different base, and the bases count DOWN by one each step (base \(9\), then \(8\), then \(7\), and so on).
  2. Check, going down in base: \(10\) in base \(9\) is \(1 \times 9 + 0 = 9\); \(11\) in base \(8\) is \(8 + 1 = 9\); \(12\) in base \(7\) is \(7 + 2 = 9\); \(13\) in base \(6\) is \(6 + 3 = 9\); \(14\) in base \(5\) is \(5 + 4 = 9\); and \(100\) in base \(3\) is \(3 \times 3 = 9\).
  3. The blank sits where the base is \(4\), so write \(9\) in base \(4\): \(9 = 2 \times 4 + 1\), which is the numeral \(21\).
  4. So the missing entry is \(21\) β€” the number \(9\) written in base \(4\).
Stretch Β· #6 Pick any 51 numbers from \(1, 2, 3, \dots, 100\). Show that two of them must have the property that one is a multiple of the other.
Pick any 51 numbers from \(1, 2, 3, \dots, 100\). Show that two of them must have the property that one is a multiple of the other.
Show answer
Answer: one of the two is a multiple of the other
Show hints
Hint 1 of 4
When is one number a multiple of another? Doubling is a clue: \(6\) is a multiple of \(3\), and \(12\) is a multiple of both. Try grouping numbers linked by repeated doubling.
Still stuck? Show hint 2 →
Hint 2 of 4
Every whole number is an odd number times a power of 2 (its 'odd part'). Group the numbers 1 to 100 by their odd part β€” for example, odd part 3 gives \(\{3, 6, 12, 24, 48, 96\}\). How many different odd parts are possible?
Still stuck? Show hint 3 →
Hint 3 of 4
The odd parts are \(1, 3, 5, \dots, 99\) β€” exactly 50 of them. So there are 50 groups (boxes). You're picking 51 numbers.
Show solution
Approach: Pigeonhole on 'odd part' β€” 51 numbers, 50 odd parts
  1. Any whole number can be written as (an odd number) \(\times\) (a power of 2); call the odd factor its 'odd part'. For instance \(40 = 5\times 2^3\).
  2. Group the numbers 1 to 100 by odd part, e.g. \(\{1,2,4,8,16,32,64\}\), \(\{3,6,12,24,48,96\}\), \(\{5,10,20,40,80\}, \dots\). The possible odd parts are \(1,3,5,\dots,99\), which is 50, so there are 50 boxes.
  3. Drop your 51 chosen numbers into the 50 boxes. Since \(51 > 50\), two of them, say \(a < b\), share a box.
  4. In one box every number is a power of 2 times the same odd part, so \(b\) equals \(a\) times some power of 2 β€” making \(b\) a multiple of \(a\).
Stretch Β· #8 Bending a wire of whole-number length \(n\) at two marks to make a triangle gives some number of bending-point choices. The counts for...
Bending a wire of whole-number length \(n\) at two marks to make a triangle gives some number of bending-point choices. The counts for lengths 3 through 15 are: 1, 0, 3, 1, 6, 3, 10, 6, 15, 10, 21, 15, 28. The row looks scrambled. What sequence of numbers is hidden inside it? (Hint: look at odd lengths and even lengths separately.)
Show answer
Answer: the triangular numbers 1, 3, 6, 10, 15, 21, 28, ...
Show hints
Hint 1 of 4
The numbers jump around because TWO patterns are tangled together. Separate them: write down only the odd-length answers, then only the even-length answers.
Still stuck? Show hint 2 →
Hint 2 of 4
Odd lengths 3,5,7,9,11,13,15 give 1,3,6,10,15,21,28. Even lengths 4,6,8,10,12,14 give 0,1,3,6,10,15. Do you recognize 1,3,6,10,15,...?
Still stuck? Show hint 3 →
Hint 3 of 4
These are the TRIANGULAR NUMBERS: 1, 3, 6, 10, 15, 21, 28, ... formed by 1, 1+2, 1+2+3, 1+2+3+4, and so on. The \(k\)-th one is \(1+2+\cdots+k\).
Show solution
Approach: Split odd and even lengths to reveal triangular numbers
  1. Separate the row by parity. Odd lengths 3, 5, 7, 9, 11, 13, 15 give 1, 3, 6, 10, 15, 21, 28. Even lengths 4, 6, 8, 10, 12, 14 give 0, 1, 3, 6, 10, 15.
  2. Both lists are the triangular numbers \(T_k = 1 + 2 + \cdots + k\): \(T_1=1, T_2=3, T_3=6, T_4=10, T_5=15, T_6=21, T_7=28\).
  3. Why? Counting by the first bend gives a staircase \(1 + 2 + 3 + \cdots\), exactly the X-staircase from the 9-inch wire. Odd lengths start one row higher than even lengths (an even wire wastes its exact-middle mark), so the even list is shifted down.
  4. So the hidden pattern is the triangular numbers \(1, 3, 6, 10, 15, 21, 28, \dots\), interleaved — and an even-length wire gives the same count as the odd-length wire 3 inches shorter (14 gives 15, same as 11; 10 gives 6, same as 7).
Stretch Β· #11 A lattice point has both coordinates whole numbers, like \((4, 3)\). A straight line through the origin passes through the lattice point...
A lattice point has both coordinates whole numbers, like \((4, 3)\). A straight line through the origin passes through the lattice point \((6, 4)\). What is the lattice point on this line that is CLOSEST to the origin (other than the origin itself)?
Show answer
Answer: (3, 2)
Show hints
Hint 1 of 4
Find the slope of the line through \((0,0)\) and \((6, 4)\): rise over run is \(\tfrac{4}{6}\). Reduce it.
Still stuck? Show hint 2 →
Hint 2 of 4
\(\tfrac{4}{6} = \tfrac{2}{3}\) (go right 3, up 2). Once a line through the origin hits one lattice point, it hits all whole-number multiples of it.
Still stuck? Show hint 3 →
Hint 3 of 4
From \((0,0)\) step right 3, up 2 to land on a lattice point. What is the first one you reach?
Show solution
Approach: Reduce the slope to lowest terms
  1. The line through \((0,0)\) and \((6,4)\) has slope \(\tfrac{4}{6} = \tfrac{2}{3}\): go right 3, up 2.
  2. A line through the origin passes through every whole-number multiple of a lattice point on it: \((3,2), (6,4), (9,6), (12,8), \dots\)
  3. The closest one to the origin is the smallest step, \((3, 2)\), where the slope \(\tfrac{2}{3}\) is already in lowest terms.
  4. So the closest lattice point is \((3, 2)\).
Stretch Β· #12 Mark a point on a circle. Spin it by a fixed angle to get the next dot, spin again, and so on. If you spin by \(40^\circ\) each time,...
Mark a point on a circle. Spin it by a fixed angle to get the next dot, spin again, and so on. If you spin by \(40^\circ\) each time, how many dots are there before you land back exactly on the starting point?
Show answer
Answer: 9 dots
Show hints
Hint 1 of 4
You are back at the start when the total amount you've spun adds up to a whole number of full circles.
Still stuck? Show hint 2 →
Hint 2 of 4
A full circle is \(360^\circ\). Keep adding \(40^\circ\): 40, 80, 120, ...
Still stuck? Show hint 3 →
Hint 3 of 4
When do you first reach a multiple of 360?
Show solution
Approach: Find when the total spin first completes whole circles
  1. You return to the start exactly when your total spin is a whole number of complete circles (\(360^\circ, 720^\circ, \dots\)).
  2. Spinning \(40^\circ\) each time, after \(n\) spins the total is \(40n\) degrees. The first time this is a multiple of 360 is when \(40n = 360\), so \(n = 9\).
  3. So there are 9 dots before returning. (For comparison, spinning \(90^\circ\) would give 4 dots, a square.)
  4. The answer is 9 dots.
Stretch Β· #16 Find the smallest whole number \(n\) that leaves remainder \(1\) when divided by \(5\), and remainder \(3\) when divided by \(7\)....
Find the smallest whole number \(n\) that leaves remainder \(1\) when divided by \(5\), and remainder \(3\) when divided by \(7\). (Hint: you can find it by smart listing β€” no fancy formula needed!)
Show answer
Answer: 31
Show hints
Hint 1 of 4
Start with the harder condition. List numbers that leave remainder \(3\) when divided by \(7\): \(3, 10, 17, 24, 31, \dots\)
Still stuck? Show hint 2 →
Hint 2 of 4
Now go down that list and check which ones also leave remainder \(1\) when divided by \(5\) (the ones ending in \(1\) or \(6\)).
Still stuck? Show hint 3 →
Hint 3 of 4
Check each: does \(3\) leave remainder \(1\) mod \(5\)? Does \(10\)? Does \(17\)? Keep going.
Show solution
Approach: Smart listing and checking against the second condition
  1. Write the numbers that leave remainder \(3\) when divided by \(7\): \(3, 10, 17, 24, 31, 38, \dots\)
  2. Check each for 'remainder \(1\) when divided by \(5\)': \(3 \to 3\) (no), \(10 \to 0\) (no), \(17 \to 2\) (no), \(24 \to 4\) (no), \(31 \to 1\) (yes!).
  3. So \(n = 31\).
  4. Double-check: \(31 = 6 \times 5 + 1\) (remainder \(1\)) and \(31 = 4 \times 7 + 3\) (remainder \(3\)). Both work.
Stretch Β· #21 Pick any 7 numbers from \(1, 2, 3, \dots, 12\). Show that among them, one number is a multiple of another.
Pick any 7 numbers from \(1, 2, 3, \dots, 12\). Show that among them, one number is a multiple of another.
Show answer
Answer: one of two numbers is a multiple of the other
Show hints
Hint 1 of 4
Use the same 'odd part' idea as the 1-to-100 problem: every number is an odd number times a power of 2.
Still stuck? Show hint 2 →
Hint 2 of 4
Group the numbers 1 to 12 by their odd part. For example odd part 3 gives \(\{3, 6, 12\}\). The odd parts available are \(1, 3, 5, 7, 9, 11\).
Still stuck? Show hint 3 →
Hint 3 of 4
There are 6 odd numbers in 1–12, so 6 groups (boxes). You're picking 7 numbers.
Show solution
Approach: Pigeonhole on 'odd part' β€” 7 numbers, 6 odd parts
  1. Every number is (an odd number) \(\times\) (a power of 2). Group the numbers 1 to 12 by their odd part: \(\{1,2,4,8\}, \{3,6,12\}, \{5,10\}, \{7\}, \{9\}, \{11\}\).
  2. The odd parts are \(1,3,5,7,9,11\) β€” that's 6 groups, so 6 boxes.
  3. Pick your 7 numbers and drop them into the boxes. Since \(7 > 6\), two numbers \(a < b\) share an odd part.
  4. In one box every number is the same odd part times a power of 2, so \(b\) is \(a\) times a power of 2 β€” making \(b\) a multiple of \(a\).
Stretch Β· #22 Pick two whole numbers with \(0 < m < n\). Build \(p = n^2 - m^2\), \(q = 2mn\), \(r = m^2 + n^2\); these always satisfy \(p^2 + q^2 =...
Pick two whole numbers with \(0 < m < n\). Build \(p = n^2 - m^2\), \(q = 2mn\), \(r = m^2 + n^2\); these always satisfy \(p^2 + q^2 = r^2\). Using \(m = 1, n = 2\), find the value of \(p\) (the smaller leg).
Show answer
Answer: p = 3 (the triple is 3, 4, 5)
Show hints
Hint 1 of 4
First test the machine: with \(m = 1, n = 2\), compute \(p = n^2 - m^2\).
Still stuck? Show hint 2 →
Hint 2 of 4
\(p = 2^2 - 1^2\). Then \(q = 2 \times 1 \times 2\) and \(r = 1^2 + 2^2\). Do you recognize the triple?
Still stuck? Show hint 3 →
Hint 3 of 4
To see why it always works, compute \(p^2 + q^2 = (n^2 - m^2)^2 + (2mn)^2\) and simplify.
Show solution
Approach: Test the generator, then prove the identity by expanding
  1. With \(m = 1, n = 2\): \(p = 2^2 - 1^2 = 3\), \(q = 2 \times 1 \times 2 = 4\), \(r = 1^2 + 2^2 = 5\) β€” the famous \(3, 4, 5\) triple, and \(3^2 + 4^2 = 25 = 5^2\).
  2. Prove it always works: \((n^2 - m^2)^2 = n^4 - 2m^2 n^2 + m^4\) and \((2mn)^2 = 4m^2 n^2\).
  3. Adding, the middle terms combine: \(n^4 + 2m^2 n^2 + m^4 = (n^2 + m^2)^2 = r^2\), so \(p^2 + q^2 = r^2\) for every \(m < n\). (\(m=2, n=3\) gives \(5, 12, 13\).)
  4. So for \(m = 1, n = 2\) the smaller leg is \(p = 3\).
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)·…
  • Divisor SUM formula: (1 + p + … + pa)(1 + q + … + qb)·… — one bracket per prime, then multiply.
  • Odd divisors: cover the 2's, count the rest. Even divisors: total − odd.
  • 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).
  • Scaling: gcd(na, nb) = nΒ·gcd(a, b) and lcm[na, nb] = nΒ·lcm[a, b]. Coprime ⟹ lcm = product: if gcd(a,b)=1 then lcm[a,b] = ab.
  • Composite test: split into RELATIVELY PRIME pieces (36 = 4Β·9 βœ“, not 3Β·12); the split is valid only when the pieces' lcm equals the original.
  • Remainder shortcut: if every remainder is (divisor βˆ’ 1), answer = LCM βˆ’ 1; if every remainder is 1, answer = LCM + 1.
  • 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.
  • Splitting a composite the wrong way. To test divisibility by 36, use 4×9 (coprime), NOT 3×12 — 3 and 12 share a factor, so “divisible by 3 and 12” only forces divisibility by 12. The pieces must be relatively prime (their lcm equals the original).
  • GCD × LCM = product is for TWO numbers only. It fails for three or more.
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.
  • 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 — the same pairing idea behind the divisor-sum trick in chapter 4.)
  • 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).