CBSE Math Revision Start revising
Extension & competition maths

Junior number theory problems (ages 11 to 13)

28 original competition-style problems: divisibility, primes, remainders and digits. Try each one before opening the hints; the second hint gives more away, and the full solution explains why the method works and where the idea leads.

Filter by strategy

Answer a problem to track what you have solved.

For teachers: project, add to a worksheet or set as homework

Press Project on any problem to show it full screen with a timer, the hints, the answer and the worked solution one step at a time (arrow keys move between problems; Space reveals the next step; F full screen; Esc closes). Switch on the ‘Add to worksheet’ buttons, pick problems, then print them from the worksheet builder or set them as homework for a class, with the full solutions as the mark scheme. Free problems are free for every class; problems marked ‘With a plan’ can be set by teachers with a plan or school licence. Ready-made sessions: maths club packs.

Your worksheet basket is empty.Open worksheet builderSet as homework

Problem J01

Number theoryShort answer

How many whole numbers from 1 to 200 have digits that add up to 5?

Hint

Sort them by how many digits they have: one digit, two digits, then three digits starting with 1.

Second hint

One digit: just 5. Two digits: the tens digit is 1 to 5. Three digits from 100 to 199: the last two digits add to 4.

Full worked solution

Answer: 11

  1. Split the numbers 1 to 200 by how many digits they have; the cases cannot overlap.
  2. One digit: only 5 has digit sum 5. That is 1 number.
  3. Two digits 10a + b with a ≥ 1 and a + b = 5: a can be 1, 2, 3, 4 or 5, giving 14, 23, 32, 41, 50. That is 5 numbers.
  4. Three digits from 100 to 199: the first digit is 1, so the last two digits must add to 4: 104, 113, 122, 131, 140. That is 5 numbers.
  5. 200 has digit sum 2, so it does not count.
  6. Total: 1 + 5 + 5 = 11.

Why this works: Splitting a count into cases that cannot overlap (here, by number of digits) turns one messy count into several small, easy ones.

Where it leads: Counting numbers with a given digit sum is a ‘stars and bars’ problem in disguise; the restriction that digits are at most 9 is what makes larger cases interesting.

Strategy: Organised cases

Problem J02

Number theoryMultiple choice

What is the smallest positive whole number that leaves remainder 1 when divided by 4, remainder 2 when divided by 5 and remainder 3 when divided by 6?

Hint

Each remainder is 3 less than the divisor. What happens if you add 3 to the number?

Second hint

So n + 3 is a multiple of 4, 5 and 6. What is their lowest common multiple?

Full worked solution

Answer: B, 57

  1. Look at the remainders: 1 on dividing by 4, 2 by 5, 3 by 6. Each is exactly 3 less than the divisor.
  2. So n + 3 leaves remainder 0 on dividing by 4, by 5 and by 6: n + 3 is a common multiple of 4, 5 and 6.
  3. The lowest common multiple: 4 = 22, 5, 6 = 2 × 3, so LCM = 22 × 3 × 5 = 60.
  4. The smallest positive choice is n + 3 = 60, so n = 57.
  5. Check: 57 = 4 × 14 + 1, 57 = 5 × 11 + 2, 57 = 6 × 9 + 3. ✓ (117 = 120 − 3 also works but is larger.)
  6. Answer: 57 (B).

Why this works: Spotting that every remainder is ‘divisor minus 3’ turns three conditions into one: n + 3 is a common multiple. Look for a shift that makes remainders line up.

Where it leads: When the remainders do not line up so neatly, the Chinese remainder theorem still guarantees a solution as long as the divisors share no common factor.

Strategy: Working backwards, Parity and remainders

Problem J03

Number theoryMultiple choice

How many three-digit numbers have digits whose product is 24 and are divisible by 4?

Hint

A number is divisible by 4 when its last two digits form a multiple of 4. List the digit sets with product 24 first.

Second hint

Digit sets with product 24: {1, 3, 8}, {1, 4, 6}, {2, 2, 6}, {2, 3, 4}. For each, which orderings end in a multiple of 4?

Full worked solution

Answer: C, 4

  1. Find every set of three digits (1 to 9, as 0 would make the product 0) with product 24 = 23 × 3.
  2. The sets are {1, 3, 8}, {1, 4, 6}, {2, 2, 6} and {2, 3, 4}.
  3. A number is divisible by 4 exactly when its last two digits form a multiple of 4.
  4. {1, 3, 8}: possible endings 13, 31, 18, 81, 38, 83 — none is a multiple of 4.
  5. {1, 4, 6}: endings 16 and 64 work, giving 416 and 164 (14, 41, 46, 61 do not).
  6. {2, 2, 6}: endings 22, 26, 62 — none works.
  7. {2, 3, 4}: endings 24 and 32 work, giving 324 and 432 (23, 34, 42, 43 do not).
  8. Total: 164, 416, 324, 432, which is 4 numbers (C).

Why this works: Two filters are easier one at a time: first the product condition gives a short list of digit sets, then the divisibility-by-4 test only needs the last two digits.

Where it leads: Divisibility by 4 depends only on the last two digits because 100 is a multiple of 4. For 8 you need the last three digits, since 1000 is a multiple of 8.

Strategy: Organised cases

Problem J04

Number theoryMultiple choice

What is the units digit of 31 + 32 + 33 + … + 32026?

Hint

Write down the units digits of the first few powers of 3. They repeat.

Second hint

The units digits of 3, 32, 33, 34 are 3, 9, 7, 1, and each block of four adds to 20. How many complete blocks are in 2026 terms?

Full worked solution

Answer: B, 2

  1. Only units digits matter. Write the units digits of 31, 32, 33, 34: 3, 9, 7, 1. Then 35 ends in 3 again, so the pattern repeats every 4.
  2. One full block of four adds 3 + 9 + 7 + 1 = 20, which ends in 0.
  3. 2026 = 4 × 506 + 2, so the sum is 506 full blocks followed by 32025 + 32026.
  4. The 506 blocks contribute a units digit of 0.
  5. 32025 is first in its block (units digit 3) and 32026 second (units digit 9): 3 + 9 = 12.
  6. The units digit of the whole sum is 2 (B).

Why this works: Units digits of powers always cycle, because each one depends only on the previous units digit. Grouping whole cycles leaves only a short leftover to add.

Where it leads: Cycles of last digits are modular arithmetic; Euler’s theorem says the cycle length always divides 4 for powers of numbers ending in 1, 3, 7 or 9.

Strategy: Spot the pattern and generalise

Problem J05

Number theoryShort answer

How many of the factors of 360 are multiples of 6?

Hint

A factor of 360 that is a multiple of 6 is 6 times a factor of 360 ÷ 6.

Second hint

360 ÷ 6 = 60, and 60 = 22 × 3 × 5. How many factors does 60 have?

Full worked solution

Answer: 12

  1. Any factor d of 360 that is a multiple of 6 can be written as d = 6k.
  2. 6k divides 360 exactly when k divides 360 ÷ 6 = 60.
  3. So we just count the factors of 60.
  4. 60 = 22 × 3 × 5. A factor chooses a power of 2 (3 ways: 20, 21, 22), of 3 (2 ways) and of 5 (2 ways).
  5. Number of factors: 3 × 2 × 2 = 12. (They are 6, 12, 18, 24, 30, 36, 60, 72, 90, 120, 180, 360.)

Why this works: ‘Factors of N that are multiples of m’ match one-to-one with factors of N/m. Counting factors from a prime factorisation (add one to each power, then multiply) does the rest.

Where it leads: Matching factors of 360 that are multiples of 6 with factors of 60 is a one-to-one correspondence, a key counting idea.

Strategy: Working backwards

Problem J06

Number theoryShort answer

Mia writes the numbers 1 to 30. She circles every number that is a multiple of 2 or a multiple of 3, but not a multiple of 5. How many numbers does she circle?

Hint

First count the multiples of 2 or 3, then remove the ones that are multiples of 5.

Second hint

Multiples of 2 or 3 up to 30: 15 + 10 − 5 = 20. Which of these are multiples of 5?

Full worked solution

Answer: 16

  1. Multiples of 2 from 1 to 30: 30 ÷ 2 = 15.
  2. Multiples of 3: 30 ÷ 3 = 10.
  3. Multiples of both (that is, of 6) were counted twice: 30 ÷ 6 = 5.
  4. Multiples of 2 or 3: 15 + 10 − 5 = 20.
  5. Remove those that are also multiples of 5: 10, 15, 20, 30 (4 numbers; 5 and 25 are not multiples of 2 or 3).
  6. Circled numbers: 20 − 4 = 16.

Why this works: This is inclusion–exclusion: when two lists overlap, add them and subtract the overlap once, so nothing is counted twice.

Where it leads: Combining ‘or’ and ‘but not’ conditions is inclusion–exclusion; a Venn diagram with three circles keeps track of every region.

Strategy: Count the opposite, Organised cases

Problem J07

Number theoryShort answer

A two-digit number is 3 more than 4 times the sum of its digits. What is the largest such number?

Hint

Write the number as 10a + b, where a is the tens digit and b the units digit.

Second hint

10a + b = 4(a + b) + 3 simplifies to 6a = 3b + 3, i.e. b = 2a − 1.

Full worked solution

Answer: 59

  1. Write the number as 10a + b, where a (1 to 9) is the tens digit and b (0 to 9) the units digit.
  2. The condition is 10a + b = 4(a + b) + 3.
  3. Expand: 10a + b = 4a + 4b + 3, so 6a − 3b = 3, and dividing by 3: 2a − b = 1, i.e. b = 2a − 1.
  4. b must be a digit, so 2a − 1 ≤ 9, giving a ≤ 5.
  5. a = 1, 2, 3, 4, 5 gives 11, 23, 35, 47, 59.
  6. Check the largest: 4 × (5 + 9) + 3 = 59. ✓ The answer is 59.

Why this works: Writing a number in terms of its digits (10a + b) turns a word puzzle into a simple equation between small whole numbers, which you can then list completely.

Where it leads: Equations in digits have whole-number solutions only, with every digit between 0 and 9: those limits do the rest of the work.

Strategy: Spot the pattern and generalise

Problem J41

Number theoryShort answer

I am a two-digit number. Reverse my digits and add the result to me: you get 121. My tens digit is 3 more than my units digit. What number am I?

Hint

Write the number as 10a + b. What is (10a + b) + (10b + a)?

Second hint

The sum is 11(a + b), so a + b = 11. Combine that with a = b + 3.

Full worked solution

Answer: 74

  1. Write the number as 10a + b, where a is the tens digit and b the units digit.
  2. Reversing gives 10b + a, and the sum is 11a + 11b = 11(a + b).
  3. 11(a + b) = 121, so a + b = 11.
  4. Also a = b + 3, so 2b + 3 = 11, giving b = 4 and a = 7.
  5. The number is 74. Check: 74 + 47 = 121.

Why this works: Writing a number by its digits (10a + b) turns a puzzle about digits into ordinary algebra, and the ‘reverse and add’ sum always factorises as 11(a + b).

Where it leads: Every ‘reverse and add’ sum of a two-digit number is a multiple of 11. For three digits, (100a + 10b + c) − (100c + 10b + a) = 99(a − c): the start of many digit tricks.

Strategy: Spot the pattern and generalise

Problem J42

Number theoryMultiple choice

What is the units digit of 72026?

Hint

Work out the units digits of 7, 72, 73, 74, 75. What do you notice?

Second hint

The units digits repeat every 4 powers. Where does 2026 sit in that cycle?

Full worked solution

Answer: E, 9

  1. Only the units digit matters, so track it: 7, 49 → 9, 9 × 7 = 63 → 3, 3 × 7 = 21 → 1, then 7 again.
  2. So the units digits cycle 7, 9, 3, 1 with period 4.
  3. 2026 = 4 × 506 + 2, so 72026 is in position 2 of the cycle.
  4. Position 2 is 9: the answer is 9 (E).

Why this works: The units digit of a product depends only on the units digits of the factors, so powers repeat in a short cycle. Dividing the exponent by the cycle length finds the place in the cycle.

Where it leads: This is arithmetic modulo 10. The same idea, done modulo any number, is the heart of modular arithmetic and of Fermat’s little theorem.

Strategy: Spot the pattern and generalise, Parity and remainders

Problem J43

Number theoryShort answer

How many of the whole numbers from 1 to 100 are divisible by 3 or by 7 (or both)?

Hint

Count the multiples of 3 and the multiples of 7 separately. Which numbers have you counted twice?

Second hint

Numbers divisible by both 3 and 7 are the multiples of 21.

Full worked solution

Answer: 43

  1. Multiples of 3 up to 100: 3, 6, …, 99, which is 33 numbers.
  2. Multiples of 7 up to 100: 7, 14, …, 98, which is 14 numbers.
  3. Numbers divisible by both are multiples of 21: 21, 42, 63, 84, which is 4 numbers. They were counted twice.
  4. Total: 33 + 14 − 4 = 43.

Why this works: Adding the two counts counts the overlap twice, so subtract it once. This is the simplest case of the inclusion–exclusion principle.

Where it leads: With three conditions you add the singles, subtract the pairs and add back the triple. Inclusion–exclusion also counts derangements and numbers coprime to n.

Strategy: Organised cases, Count the opposite

Problem J44

Number theoryShort answer

What is the smallest whole number that has exactly 5 factors (including 1 and itself)?

Hint

Most numbers have an even number of factors, because factors come in pairs. When does a number have an odd number?

Second hint

Factors pair up as d and n/d, except when d = n/d. So the number is a perfect square. Check the squares in order.

Full worked solution

Answer: 16

  1. Factors come in pairs d and n/d. The count is odd only when one factor is paired with itself, i.e. n is a perfect square.
  2. Check squares: 4 has 3 factors (1, 2, 4); 9 has 3; 16 has 1, 2, 4, 8, 16: five factors.
  3. So the smallest is 16.
  4. In general a number with exactly 5 factors is p4 for a prime p (since 5 is prime, the formula (a + 1)(b + 1)… = 5 forces one prime to the 4th power); the smallest is 24.

Why this works: Pairing each factor with its partner explains why non-squares have an even number of factors, and narrows the search to squares.

Where it leads: A number with exactly 3 factors is the square of a prime. Which numbers have exactly 4 factors? (p3 or pq.)

Strategy: Proof techniques, Extremal principle

Problem J45

Number theoryMultiple choice

How many whole numbers divide 72 exactly (including 1 and 72)?

Hint

Write 72 as a product of primes.

Second hint

72 = 23 × 32. A factor uses 2 between 0 and 3 times and 3 between 0 and 2 times.

Full worked solution

Answer: C, 12

  1. 72 = 23 × 32.
  2. Every factor is 2a × 3b with a = 0, 1, 2 or 3 (4 choices) and b = 0, 1 or 2 (3 choices).
  3. Each pair of choices gives a different factor, so there are 4 × 3 = 12 factors.
  4. Answer: 12 (C).

Why this works: A factor is built by choosing how many of each prime to use, and the choices are independent, so you multiply the numbers of choices.

Where it leads: In general, n = paqb… has (a + 1)(b + 1)… factors. A number has an odd number of factors exactly when it is a perfect square.

Strategy: Organised cases

Problem J46

Number theoryShort answer

Zara writes the numbers 1, 2, 3, …, 50 in a row to make one long number: 123456789101112…4950. How many digits does she write?

Hint

How many one-digit numbers are there, and how many two-digit ones?

Second hint

1 to 9 use one digit each; 10 to 50 use two digits each.

Full worked solution

Answer: 91

  1. 1 to 9: 9 numbers with 1 digit each, so 9 digits.
  2. 10 to 50: 50 − 10 + 1 = 41 numbers with 2 digits each, so 82 digits.
  3. Total: 9 + 82 = 91 digits.

Why this works: Grouping numbers by how many digits they have turns the count into two easy multiplications. Note the ‘+ 1’ when counting from 10 to 50 inclusive.

Where it leads: The same method finds which digit is in position 1000 of the long number: subtract the digits used by each group until you land inside one.

Strategy: Organised cases

Problem J47

Number theoryShort answer

A number is called tidy if its digits are all different and add up to 10. How many three-digit tidy numbers have digits in increasing order from left to right (like 136)?

Hint

Choose three different digits that add to 10; there is only one way to put them in increasing order.

Second hint

The first digit cannot be 0. Try the smallest digit = 1, then 2, then 3.

Full worked solution

Answer: 4

  1. Increasing digits with a non-zero first digit means three different digits from 1 to 9, smallest first.
  2. Smallest digit 1: the other two add to 9 and are different, both above 1: 2 + 7, 3 + 6, 4 + 5. That gives 127, 136, 145.
  3. Smallest digit 2: the other two add to 8, both above 2: 3 + 5. That gives 235.
  4. Smallest digit 3: the other two add to 7, both above 3: impossible (4 + 3 repeats 3).
  5. Total: 4 numbers: 127, 136, 145, 235.

Why this works: Asking for increasing digits means each set of digits gives exactly one number, so you count sets, not arrangements.

Where it leads: Counting sets of different whole numbers with a fixed sum is counting partitions into distinct parts, a topic Euler studied with generating functions.

Strategy: Organised cases

Problem J48

Number theoryMultiple choice

The product of three different whole numbers, each greater than 1, is 60. What is the largest possible value of their sum?

Hint

List every way to write 60 as a product of three different whole numbers bigger than 1.

Second hint

Go in order of the smallest factor: 2, then 3, then 4. The smallest factor cannot be 4 or more, since 4 × 5 × 6 is already more than 60.

Full worked solution

Answer: D, 15

  1. Write 60 = a × b × c with 1 < a < b < c, and organise by a.
  2. a = 2: b × c = 30 with 2 < b < c gives 3 × 10 or 5 × 6. Sums: 2 + 3 + 10 = 15 and 2 + 5 + 6 = 13.
  3. a = 3: b × c = 20 with 3 < b < c gives 4 × 5. Sum: 12.
  4. a ≥ 4 is impossible, because then a × b × c ≥ 4 × 5 × 6 = 120.
  5. The largest sum is 15 (D).

Why this works: For a fixed product, the sum is largest when the numbers are spread out (one big, the others small) and smallest when they are close together. Listing in order of the smallest factor makes sure no case is missed.

Where it leads: ‘Close together gives the smallest sum’ is a whole-number version of the AM–GM inequality: for a fixed product, the sum is least when all the numbers are equal.

Strategy: Organised cases, Extremal principle

Problem J49

Number theoryShort answer

What is the remainder when 2026 × 2027 × 2028 is divided by 7?

Hint

You do not need the product. What is the remainder when 2026 is divided by 7?

Second hint

2023 = 7 × 289, so 2026, 2027 and 2028 leave remainders 3, 4 and 5.

Full worked solution

Answer: 4

  1. 2023 = 7 × 289, so 2026 = 2023 + 3 leaves remainder 3; 2027 leaves 4; 2028 leaves 5.
  2. The remainder of a product equals the remainder of the product of the remainders.
  3. 3 × 4 × 5 = 60 = 7 × 8 + 4.
  4. The remainder is 4.

Why this works: Remainders multiply: if a = 7m + r and b = 7n + s, then ab = 7(…) + rs. So you can replace each number by its remainder before multiplying.

Where it leads: This rule is what makes modular arithmetic work, and it is how computers handle huge numbers in cryptography without ever writing them out.

Strategy: Parity and remainders

Problem J50

Number theoryMultiple choice

How many two-digit numbers are equal to the product of their digits plus the sum of their digits? (For example, 23 would need 2 × 3 + 2 + 3 = 23.)

Hint

Write the number as 10a + b and set up an equation.

Second hint

10a + b = ab + a + b simplifies to 9a = ab.

Full worked solution

Answer: D, 9

  1. Let the number be 10a + b with a from 1 to 9 and b from 0 to 9.
  2. The condition is 10a + b = ab + a + b.
  3. Subtract a + b from both sides: 9a = ab. Since a ≠ 0, divide by a: b = 9.
  4. So every two-digit number ending in 9 works (19, 29, …, 99) and no other does: 9 numbers (D).
  5. Check: 39 gives 3 × 9 + 3 + 9 = 27 + 12 = 39. ✓

Why this works: Writing the number as 10a + b turns the digit condition into algebra, and the equation collapses so that a can be anything while b is forced.

Where it leads: Try the same with three-digit numbers and ‘product + sum’ or other combinations: algebra quickly tells you whether any solutions exist at all.

Strategy: Spot the pattern and generalise

Problem J51

Number theoryShort answer

A palindrome reads the same forwards and backwards, like 4334. How many four-digit palindromes are divisible by 9?

Hint

A four-digit palindrome looks like abba. What is its digit sum?

Second hint

The digit sum is 2(a + b). For divisibility by 9, a + b must be 9 or 18.

Full worked solution

Answer: 10

  1. A four-digit palindrome is abba with a from 1 to 9 and b from 0 to 9. Its digit sum is 2(a + b).
  2. A number is divisible by 9 exactly when its digit sum is. 2(a + b) is a multiple of 9 only if a + b is (9 and 2 share no factor).
  3. a + b ranges from 1 to 18, so a + b = 9 or 18.
  4. a + b = 9: a = 1, …, 9 with b = 9 − a: 9 palindromes. a + b = 18: only a = b = 9: 1 palindrome.
  5. Total: 10.

Why this works: The digit-sum test for 9 works because 10 leaves remainder 1 on division by 9, so each digit contributes just itself. The palindrome shape halves the number of free digits.

Where it leads: Every four-digit palindrome abba = 1001a + 110b is a multiple of 11. Can you prove that every palindrome with an even number of digits is divisible by 11?

Strategy: Organised cases, Parity and remainders

Problem J52

Number theoryShort answer

What is the smallest whole number whose digits multiply together to give 120?

Hint

Fewer digits means a smaller number. Can two digits multiply to 120?

Second hint

The largest product of two digits is 81, so you need three digits. Then make the first digit as small as possible.

Full worked solution

Answer: 358

  1. Two digits give a product of at most 9 × 9 = 81, so at least three digits are needed (and a three-digit number beats any longer one).
  2. 120 = 23 × 3 × 5, so one digit must be 5 (no other digit contains the factor 5). The other two multiply to 24.
  3. Pairs of digits with product 24: 3 × 8 and 4 × 6. So the digit sets are {3, 5, 8} and {4, 5, 6}. (A digit 1 would leave two digits multiplying to 120, impossible; a digit 2 would leave 60, also impossible.)
  4. Put the digits in increasing order and take the smaller: 358 < 456.
  5. The answer is 358.

Why this works: ‘Smallest number’ means: first the fewest digits, then the smallest leading digit. Prime factorisation tells you exactly which digits are possible.

Where it leads: Repeatedly multiplying the digits of a number until you reach one digit gives its ‘multiplicative persistence’. Nobody knows a number with persistence above 11.

Strategy: Extremal principle, Organised cases

Problem J53

Number theoryMultiple choice

For how many prime numbers p are p + 10 and p + 20 also both prime?

Hint

Think about remainders on dividing by 3.

Second hint

p, p + 10 and p + 20 leave remainders p, p + 1 and p + 2 on dividing by 3, so one of them is a multiple of 3.

Full worked solution

Answer: B, 1

  1. On dividing by 3, 10 leaves remainder 1 and 20 leaves remainder 2.
  2. So p, p + 10, p + 20 leave three different remainders 0, 1, 2 in some order: exactly one of them is a multiple of 3.
  3. A prime that is a multiple of 3 must be 3 itself. p + 10 and p + 20 are bigger than 3, so p = 3.
  4. Check: 3, 13, 23 are all prime. So there is exactly 1 such prime (B).

Why this works: Three numbers that cover every remainder mod 3 must include a multiple of 3. That one fact rules out every case except a tiny one.

Where it leads: Primes p, p + 2, p + 6 (prime triplets) can occur infinitely often as far as anyone knows, because they avoid this trap. Proving it is an open problem.

Strategy: Parity and remainders, Proof techniques

Problem J54

Number theoryShort answer

A whole number leaves remainder 3 when divided by 8. What remainder does its square leave when divided by 8?

Hint

Write the number as 8k + 3 and square it.

Second hint

(8k + 3)2 = 64k2 + 48k + 9. Which parts are multiples of 8?

Full worked solution

Answer: 1

  1. The number is 8k + 3 for some whole number k.
  2. (8k + 3)2 = 64k2 + 48k + 9.
  3. 64k2 and 48k are multiples of 8, and 9 = 8 + 1.
  4. So the square leaves remainder 1. (Check: 32 = 9, 112 = 121 = 8 × 15 + 1.)

Why this works: Writing the number as ‘multiple of 8 plus remainder’ shows that only the remainder affects the answer.

Where it leads: In fact every odd square leaves remainder 1 on division by 8. That is why a number like 8k + 7 can never be a sum of three squares (Legendre).

Strategy: Parity and remainders, Proof techniques

Problem J55

Number theoryShort answer

What is the largest three-digit number with three different digits that is divisible by both 5 and 9?

Hint

Divisible by 5 and 9 means divisible by 45.

Second hint

Count down through the three-digit multiples of 45 from the largest.

Full worked solution

Answer: 945

  1. 5 and 9 share no factor, so the number is a multiple of 45.
  2. The largest three-digit multiple of 45 is 45 × 22 = 990, but its digits repeat.
  3. The next one down is 990 − 45 = 945, with digits 9, 4, 5, all different.
  4. The answer is 945.

Why this works: When you want the largest number with a property, start at the top and work down: the first one that works is the answer.

Where it leads: Combining divisibility tests (by 5 and by 9 here) is how you test for any composite divisor: split it into coprime factors and test each.

Strategy: Extremal principle

Problem J56

Number theoryMultiple choice

The sum of five consecutive whole numbers is 2025. What is the largest of the five numbers?

Hint

The middle number is the average.

Second hint

Five consecutive numbers are m − 2, m − 1, m, m + 1, m + 2. What is their sum?

Full worked solution

Answer: D, 407

  1. Call the numbers m − 2, m − 1, m, m + 1, m + 2.
  2. Their sum is 5m, so 5m = 2025 and m = 405.
  3. The largest is m + 2 = 407 (D).

Why this works: Naming consecutive numbers around the middle one makes the plus and minus parts cancel, so the sum is just 5 times the middle number.

Where it leads: A number is a sum of k consecutive whole numbers in ways linked to its odd factors. Which numbers cannot be written as a sum of two or more consecutive positive whole numbers? (The powers of 2.)

Strategy: Symmetry

Problem J57

Number theoryShort answer

The number 30! means 1 × 2 × 3 × … × 30. How many zeros are at the end of 30! when it is written out in full?

Hint

Each zero at the end comes from a factor 10 = 2 × 5. Which is rarer in 30!: factors of 2 or factors of 5?

Second hint

Count the multiples of 5 up to 30, and remember that 25 = 5 × 5 gives two fives.

Full worked solution

Answer: 7

  1. Each final zero needs a factor 10 = 2 × 5. There are far more factors of 2 than of 5, so count the 5s.
  2. Multiples of 5 up to 30: 5, 10, 15, 20, 25, 30: six numbers, one 5 each.
  3. 25 = 52 gives one extra 5.
  4. Total fives: 6 + 1 = 7, so 30! ends in 7 zeros.

Why this works: Zeros at the end count factors of 10, and the scarcer prime (5) decides how many 10s you can make.

Where it leads: Legendre’s formula counts the power of any prime in n!: add ⌊n/p⌋ + ⌊n/p2⌋ + …. It also tells you when binomial coefficients are divisible by p.

Strategy: Extremal principle, Organised cases

Problem J58

Number theoryShort answer

How many whole numbers from 1 to 1000 are both perfect squares and perfect cubes?

Hint

A number that is a square and a cube is a power of what?

Second hint

It must be a sixth power: n6.

Full worked solution

Answer: 3

  1. If a number is both a square and a cube, every prime in it appears a number of times divisible by 2 and by 3, so by 6.
  2. So the number is a sixth power n6.
  3. 16 = 1, 26 = 64, 36 = 729, 46 = 4096 > 1000.
  4. There are 3: 1, 64 and 729.

Why this works: Looking at the powers of each prime turns ‘square and cube’ into ‘every exponent divisible by 2 and 3’, i.e. by 6.

Where it leads: The same argument shows that if a2 = b3 for whole numbers then both are sixth powers, a first step in solving equations in whole numbers.

Strategy: Proof techniques

Problem J59

Number theoryShort answer

In the four-digit number 3A6B, A and B stand for digits (they may be equal). The number is divisible by both 4 and 9. How many possible numbers are there?

Hint

Divisible by 4 depends only on the last two digits, 6B.

Second hint

So B is 0, 4 or 8. Then 3 + A + 6 + B must be a multiple of 9.

Full worked solution

Answer: 4

  1. A number is divisible by 4 when its last two digits are: 6B must be 60, 64 or 68, so B = 0, 4 or 8.
  2. Divisible by 9: the digit sum 9 + A + B is a multiple of 9, so A + B is 0, 9 or 18.
  3. B = 0: A = 0 or 9, giving 3060 and 3960. B = 4: A = 5, giving 3564. B = 8: A = 1, giving 3168.
  4. That is 4 numbers.

Why this works: Each divisibility test only looks at part of the number, so you can apply them one after the other and each one cuts the cases down.

Where it leads: Divisibility tests come from the remainders of powers of 10: 100 is a multiple of 4 (so only the last two digits matter) and 10 ≡ 1 mod 9 (so the digit sum matters).

Strategy: Organised cases

Problem J60

Number theoryMultiple choice

Amira’s age multiplied by her brother’s age is 143. Both are older than 1. What is the sum of their ages?

Hint

Try dividing 143 by small primes.

Second hint

143 = 11 × 13.

Full worked solution

Answer: A, 24

  1. 143 is not divisible by 2, 3, 5 or 7. Try 11: 143 = 11 × 13.
  2. 11 and 13 are both prime, so the only ways to write 143 as a product are 1 × 143 and 11 × 13.
  3. Both ages are greater than 1, so the ages are 11 and 13, and the sum is 24 (A).

Why this works: Prime factorisation is unique, so once you find 143 = 11 × 13 there is no other way to split it with both factors above 1.

Where it leads: Uniqueness of prime factorisation (the Fundamental Theorem of Arithmetic) is used constantly, from simplifying fractions to RSA encryption, which relies on factorising being hard for huge numbers.

Strategy: Proof techniques

Problem J61

Number theoryShort answer

What is the smallest whole number that can be written as the sum of two different primes in three different ways? (Swapping the order does not count as a new way.)

Hint

An odd number can only be 2 + (a prime), so look at even numbers.

Second hint

Check 20, 22 and 24 one by one.

Full worked solution

Answer: 24

  1. If the sum is odd, one prime is even, so it is 2: an odd number has at most one way. So the answer is even.
  2. Small even numbers have at most two ways: e.g. 16 = 3 + 13 = 5 + 11; 18 = 5 + 13 = 7 + 11; 20 = 3 + 17 = 7 + 13; 22 = 3 + 19 = 5 + 17 (11 + 11 uses the same prime twice).
  3. 24 = 5 + 19 = 7 + 17 = 11 + 13: three ways.
  4. The answer is 24.

Why this works: A parity argument removes all odd numbers at once, leaving a short, organised check of even numbers.

Where it leads: Goldbach’s conjecture says every even number above 2 is a sum of two primes. It has been checked to enormous sizes but never proved.

Strategy: Parity and remainders, Organised cases

Keep going

More Junior problems: Combinatorics · Geometry · Algebra · Probability · Logic

Number theory at other levels: Intermediate (ages 13 to 16) · Senior (ages 16 to 18) · Olympiad-style (ages 15 to 18)

Problem-solving strategies · Where next · Extension & competition maths