IGCSE Math Revision Start revising
Extension & competition maths

Intermediate number theory problems (ages 13 to 16)

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 I01

Number theoryShort answer

For how many whole numbers n from 1 to 1000 does n2 end in the digits 21?

Hint

The last two digits of n2 depend only on the last two digits of n. Which last digits can n have?

Second hint

n must end in 1 or 9. Writing n = 10a + 1, n2 ≡ 20a + 1 (mod 100): when is that 21?

Full worked solution

Answer: 40

  1. The last two digits of n2 depend only on the last two digits of n, so work with n = 10a + b, where b is the units digit and a the tens digit.
  2. n2 ends in 1, so b2 ends in 1: b = 1 or b = 9.
  3. b = 1: n2 = 100a2 + 20a + 1. Its tens digit is the units digit of 2a, which must be 2, so a ends in 1 or 6: n ends in 11 or 61.
  4. b = 9: n2 = 100a2 + 180a + 81. Its tens digit is the units digit of 18a + 8, i.e. of 8a + 8, which must be 2, so 8a ends in 4: a ends in 3 or 8: n ends in 39 or 89.
  5. Check: 112 = 121, 392 = 1521, 612 = 3721, 892 = 7921. ✓
  6. So 4 numbers in every block of 100, and 1 to 1000 is 10 blocks: 4 × 10 = 40.

Why this works: Working modulo 100 means you only ever look at the last two digits. Expanding (10a + b)2 shows exactly which digit of n controls which digit of n2.

Where it leads: Solving n2 ≡ c modulo powers of 10 digit by digit is Hensel lifting, a key tool in number theory.

Strategy: Organised cases, Spot the pattern and generalise

Problem I02

Number theoryMultiple choice

The number N is written with twelve 1s: N = 111 111 111 111. What is the largest prime factor of N that is less than 100?

Hint

111 111 111 111 = 111 111 × 1 000 001. And 111 111 = 111 × 1001.

Second hint

Factorise further: 111 = 3 × 37, 1001 = 7 × 11 × 13, and 1 000 001 = 101 × 9901.

Full worked solution

Answer: D, 37

  1. N has twelve 1s. Split it as 111111 followed by 111111: N = 111111 × 1000000 + 111111 = 111111 × 1000001.
  2. Split 111111 the same way: 111111 = 111 × 1000 + 111 = 111 × 1001.
  3. 111 = 3 × 37 and 1001 = 7 × 11 × 13.
  4. 1000001 = 101 × 9901, and neither 101 nor 9901 has a prime factor below 100 (101 is prime; 9901 is prime).
  5. So the prime factors of N below 100 are 3, 7, 11, 13 and 37. In particular 31 and 41 do not divide N.
  6. The largest is 37 (D).

Why this works: Numbers made of repeated digits split along their pattern: a block of 1s of length ab is (block of length a) × (1 000…01 …). 1001 = 7 × 11 × 13 is a factorisation worth knowing.

Where it leads: Repunits (numbers made of 1s) factor according to the divisors of their length; Rn can only be prime when n is prime.

Strategy: Spot the pattern and generalise

Problem I03

Number theoryShort answer

How many ordered pairs of positive whole numbers (a, b) satisfy ab = 2(a + b) + 20?

Hint

Move everything to one side and add 4 to both sides so the left side factorises.

Second hint

ab − 2a − 2b + 4 = 24, so (a − 2)(b − 2) = 24.

Full worked solution

Answer: 8

  1. Rearrange ab = 2(a + b) + 20 as ab − 2a − 2b = 20.
  2. Add 4 to both sides so the left factorises: ab − 2a − 2b + 4 = 24, i.e. (a − 2)(b − 2) = 24.
  3. a and b are positive, so a − 2 ≥ −1 and b − 2 ≥ −1. Both brackets negative would need (−1)(−24), impossible, and one negative makes the product negative. So both brackets are positive.
  4. Positive factor pairs of 24: 1 × 24, 2 × 12, 3 × 8, 4 × 6, and each in either order.
  5. That gives (a, b) = (3, 26), (26, 3), (4, 14), (14, 4), (5, 10), (10, 5), (6, 8), (8, 6).
  6. Check one: 6 × 8 = 48 and 2(6 + 8) + 20 = 48. ✓ There are 8 ordered pairs.

Why this works: Adding the right constant makes xy + px + qy factorise as (x + q)(y + p) − pq. Then a Diophantine equation becomes ‘list the factor pairs’.

Where it leads: Adding a constant to complete a product (Simon’s favourite factoring trick) turns many equations into divisor counts.

Strategy: Working backwards

Problem I04

Number theoryMultiple choice

What is the remainder when 2100 + 3100 is divided by 7?

Hint

23 = 8 leaves remainder 1 on division by 7, and 36 = 729 does too.

Second hint

2100 = (23)33 × 2 and 3100 = (36)16 × 34.

Full worked solution

Answer: E, 6

  1. Work modulo 7 (remainders on dividing by 7).
  2. Powers of 2: 2, 4, 8 ≡ 1. So 23 ≡ 1 and powers of 2 cycle with length 3.
  3. 100 = 3 × 33 + 1, so 2100 = (23)33 × 2 ≡ 1 × 2 = 2.
  4. Powers of 3: 3, 2, 6, 4, 5, 1, so 36 ≡ 1 and the cycle has length 6.
  5. 100 = 6 × 16 + 4, so 3100 ≡ 34 = 81 = 77 + 4 ≡ 4.
  6. Sum: 2 + 4 = 6, so the remainder is 6 (E).

Why this works: Once some power of a number leaves remainder 1, higher powers repeat in a cycle, so a huge exponent only matters through its remainder on dividing by the cycle length.

Where it leads: Fermat’s little theorem guarantees a6 ≡ 1 (mod 7) for every a not divisible by 7; the actual cycle may be shorter, like 3 for 2.

Strategy: Spot the pattern and generalise

Problem I05

Number theoryMultiple choice

What is the smallest positive multiple of 15 that has exactly 15 positive divisors?

Hint

If n = paqb…, the number of divisors is (a+1)(b+1)…. How can 15 be written as a product?

Second hint

15 = 15 × 1 = 5 × 3, so n = p14 or p4q2. n must be divisible by 3 and 5.

Full worked solution

Answer: D, 2025

  1. If n = pa qb … (prime factorisation), n has (a + 1)(b + 1)… divisors.
  2. 15 = 15 or 15 = 3 × 5, so n = p14 or n = p4 q2 for different primes p, q.
  3. n is a multiple of 15, so both 3 and 5 divide n. That rules out p14 (one prime only) and forces {p, q} = {3, 5}.
  4. The two options are 34 × 52 = 81 × 25 = 2025 and 32 × 54 = 9 × 625 = 5625.
  5. The smaller is 2025 (D). (225 = 3252 is a trap: it has only 3 × 3 = 9 divisors.)

Why this works: The divisor-count formula turns ‘exactly k divisors’ into ‘write k as a product’. To make n small, give the largest powers to the smallest primes.

Where it leads: To make a number with a given number of divisors as small as possible, give the biggest exponents to the smallest primes.

Strategy: Organised cases, Extremal principle

Problem I06

Number theoryShort answer

How many zeros are at the end of the number 1 × 3 × 5 × 7 × … × 99 × 210?

Hint

Each final zero needs one factor 2 and one factor 5. How many of each are there?

Second hint

The odd product has no factor 2, so all the 2s come from 210. Count the 5s in 1 × 3 × … × 99.

Full worked solution

Answer: 10

  1. Each zero at the end needs one factor 10 = 2 × 5, so count the 2s and the 5s.
  2. 1 × 3 × 5 × … × 99 is a product of odd numbers, so it has no factor 2. The only 2s come from 210: ten of them.
  3. Factors of 5 in the odd product: the odd multiples of 5 up to 99 are 5, 15, 25, …, 95, which is 10 numbers.
  4. 25 and 75 each contain 5 twice, adding 2 more: twelve 5s in total.
  5. Pairs 2 × 5: min(10, 12) = 10, so there are 10 zeros.

Why this works: Trailing zeros count pairs 2×5. Usually 2s are plentiful and 5s are scarce; here the odd product has no 2s, so the 2s run out first.

Where it leads: Trailing zeros count the smaller of the powers of 2 and 5; here, unusually, the 2s are scarce.

Strategy: Extremal principle

Problem I07

Number theoryShort answer

How many three-digit numbers are equal to 19 times the sum of their digits?

Hint

Write the number as 100a + 10b + c and simplify 100a + 10b + c = 19(a + b + c).

Second hint

100a + 10b + c = 19a + 19b + 19c simplifies to 81a = 9b + 18c, i.e. 9a = b + 2c.

Full worked solution

Answer: 11

  1. Write the number as 100a + 10b + c with a from 1 to 9 and b, c from 0 to 9.
  2. The condition is 100a + 10b + c = 19(a + b + c) = 19a + 19b + 19c.
  3. Rearrange: 81a = 9b + 18c, and divide by 9: 9a = b + 2c.
  4. b + 2c is at most 9 + 18 = 27, so a is 1, 2 or 3.
  5. a = 1: b + 2c = 9, with c = 0 to 4 (b = 9, 7, 5, 3, 1): 5 numbers (e.g. 190 = 19 × 10).
  6. a = 2: b + 2c = 18, with c = 5 to 9 (b = 8, 6, 4, 2, 0): 5 numbers.
  7. a = 3: b + 2c = 27 needs b = c = 9: 1 number, 399 = 19 × 21.
  8. Total: 5 + 5 + 1 = 11.

Why this works: Digit problems collapse to small linear equations once the number is written in place-value form; bounding the digits keeps the case list short.

Where it leads: Digit equations become linear equations in a, b, c with small ranges, so a short search finishes them.

Strategy: Organised cases

Problem I41

Number theoryShort answer

How many whole numbers from 1 to 100 have exactly 3 positive factors?

Hint

Factors pair up as d and n/d. When can there be an odd number of them?

Second hint

Only perfect squares have an odd number of factors. Which squares have exactly 3?

Full worked solution

Answer: 4

  1. Factors pair up as d and n/d, so a number has an odd number of factors only if it is a perfect square.
  2. If n = m2 has exactly 3 factors they are 1, m and m2, so m has no factors other than 1 and itself: m is prime.
  3. Squares of primes up to 100: 4, 9, 25, 49.
  4. So 4 numbers.

Why this works: Pairing factors explains odd counts, and then the factor list 1, m, m2 forces m to be prime.

Where it leads: The number of factors of paqb… is (a + 1)(b + 1)…; exactly 3 factors needs (a + 1)(b + 1)… = 3, i.e. p2.

Strategy: Proof techniques, Spot the pattern and generalise

Problem I42

Number theoryMultiple choice

What is the remainder when 3100 is divided by 13?

Hint

Find a small power of 3 that leaves remainder 1 on division by 13.

Second hint

33 = 27 = 2 × 13 + 1.

Full worked solution

Answer: B, 3

  1. 33 = 27 leaves remainder 1 on division by 13.
  2. So 399 = (33)33 leaves remainder 133 = 1.
  3. 3100 = 399 × 3 leaves remainder 1 × 3 = 3 (B).

Why this works: Once a power leaves remainder 1, the remainders repeat in a cycle, so huge powers reduce to small ones.

Where it leads: Fermat’s little theorem guarantees 312 leaves remainder 1 on division by 13; the actual cycle length (here 3) always divides 12.

Strategy: Spot the pattern and generalise, Parity and remainders

Problem I43

Number theoryShort answer

What is the smallest positive whole number n such that 2n is a perfect square and 3n is a perfect cube?

Hint

n can only use the primes 2 and 3 (any other prime would only make n bigger). Write n = 2a3b.

Second hint

2n square: a + 1 and b even. 3n cube: a and b + 1 multiples of 3.

Full worked solution

Answer: 72

  1. Write n = 2a3b (extra primes would only make n larger).
  2. 2n = 2a+13b is a square: a + 1 is even and b is even.
  3. 3n = 2a3b+1 is a cube: a is a multiple of 3 and b + 1 is a multiple of 3.
  4. Smallest a: odd and a multiple of 3, so a = 3. Smallest b: even with b + 1 a multiple of 3, so b = 2.
  5. n = 23 × 32 = 72. Check: 2n = 144 = 122, 3n = 216 = 63. ✓

Why this works: Being a square or a cube is a condition on each prime’s exponent separately, so the problem splits into two small puzzles about remainders.

Where it leads: Combining conditions on exponents like this is the Chinese remainder theorem in action: a must be 3 mod 6.

Strategy: Organised cases, Extremal principle

Problem I44

Number theoryShort answer

100! means 1 × 2 × 3 × … × 100. What is the largest whole number k such that 3k divides 100!?

Hint

Count the multiples of 3 up to 100, then the multiples of 9, then 27, then 81.

Second hint

Each multiple of 9 contributes one extra factor 3 beyond the one already counted.

Full worked solution

Answer: 48

  1. Multiples of 3 up to 100: ⌊100/3⌋ = 33, each giving one factor 3.
  2. Multiples of 9: 11, each giving one extra 3.
  3. Multiples of 27: 3 (27, 54, 81), one more each. Multiples of 81: 1, one more.
  4. k = 33 + 11 + 3 + 1 = 48.

Why this works: Counting in layers (multiples of 3, then 9, then 27, …) counts each factor 3 exactly once.

Where it leads: This is Legendre’s formula. A neat consequence: the power of p in n! equals (n − digit sum of n in base p)/(p − 1). Check: 100 in base 3 is 10201, digit sum 4, (100 − 4)/2 = 48.

Strategy: Organised cases, Spot the pattern and generalise

Problem I45

Number theoryMultiple choice

What is the highest common factor of 220 − 1 and 212 − 1?

Hint

Use the Euclidean algorithm: HCF(a, b) = HCF(a − b, b).

Second hint

220 − 1 − 28(212 − 1) = 28 − 1.

Full worked solution

Answer: C, 15

  1. 220 − 1 = 28(212 − 1) + (28 − 1), so HCF(220 − 1, 212 − 1) = HCF(212 − 1, 28 − 1).
  2. In the same way, HCF(212 − 1, 28 − 1) = HCF(28 − 1, 24 − 1), and 24 − 1 divides 28 − 1.
  3. The exponents follow Euclid’s algorithm on 20 and 12, ending at HCF(20, 12) = 4.
  4. So the answer is 24 − 1 = 15 (C).

Why this works: Subtracting multiples of 2m − 1 from 2n − 1 mirrors subtracting m from n, so Euclid’s algorithm on the exponents carries over.

Where it leads: In general HCF(2a − 1, 2b − 1) = 2HCF(a, b) − 1. So 2n − 1 can only be prime when n is prime (Mersenne primes).

Strategy: Spot the pattern and generalise, Proof techniques

Problem I46

Number theoryShort answer

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

Hint

For which y is 100 − 5y a multiple of 3?

Second hint

100 leaves remainder 1 on division by 3, and 5y leaves the same remainder as 2y. So y leaves remainder 2.

Full worked solution

Answer: 6

  1. We need 100 − 5y to be a positive multiple of 3.
  2. Remainders on division by 3: 100 → 1 and 5y → 2y, so 2y must leave remainder 1, i.e. y leaves remainder 2: y = 2, 5, 8, 11, 14, 17, …
  3. x > 0 needs 5y < 100, so y ≤ 19. That allows y = 2, 5, 8, 11, 14, 17.
  4. Each gives a positive x (30, 25, 20, 15, 10, 5), so there are 6 pairs.

Why this works: One solution of a linear equation in whole numbers leads to all of them: here y steps by 3 while x steps by 5.

Where it leads: ax + by = c has whole-number solutions exactly when HCF(a, b) divides c. The steps between solutions are b/h and a/h, where h = HCF(a, b).

Strategy: Parity and remainders, Organised cases

Problem I47

Number theoryShort answer

What are the last two digits of 112026? (Give them as a two-digit number.)

Hint

Write 11 = 10 + 1 and expand (10 + 1)2026.

Second hint

Every term with 102 or more ends in 00. Only the last two terms of the expansion matter.

Full worked solution

Answer: 61

  1. (1 + 10)2026 = 1 + 2026 × 10 + (terms containing 102 or higher powers).
  2. Terms with 102 or more are multiples of 100, so they do not affect the last two digits.
  3. 1 + 20260 = 20261, which ends in 61.
  4. The last two digits are 61.

Why this works: The binomial expansion of (1 + 10)n shows that, modulo 100, only the first two terms survive.

Where it leads: So 11n always ends in the digits of 10n + 1 (mod 100). The same idea gives (1 + p)n ≡ 1 + np (mod p2), a key step in number theory.

Strategy: Spot the pattern and generalise

Problem I48

Number theoryShort answer

For how many positive whole numbers n is n2 + 20 divisible by n + 2?

Hint

Divide n2 + 20 by n + 2. What is the remainder?

Second hint

n2 + 20 = (n + 2)(n − 2) + 24, so n + 2 must divide 24.

Full worked solution

Answer: 6

  1. n2 + 20 = (n + 2)(n − 2) + 24.
  2. So n + 2 divides n2 + 20 exactly when n + 2 divides 24.
  3. With n ≥ 1, n + 2 ≥ 3. Factors of 24 from 3 upwards: 3, 4, 6, 8, 12, 24.
  4. These give n = 1, 2, 4, 6, 10, 22: 6 values.

Why this works: Polynomial division turns ‘n + 2 divides a big expression’ into ‘n + 2 divides a fixed number’, leaving finitely many cases.

Where it leads: The remainder 24 is the value of n2 + 20 at n = −2: the remainder theorem. It works for any polynomial divided by n − a.

Strategy: Organised cases

Problem I49

Number theoryMultiple choice

How many positive whole numbers divide 10! = 1 × 2 × … × 10 exactly?

Hint

Find the prime factorisation of 10!.

Second hint

10! = 28 × 34 × 52 × 7.

Full worked solution

Answer: D, 270

  1. Powers of 2 in 10!: 5 + 2 + 1 = 8. Powers of 3: 3 + 1 = 4. Powers of 5: 2. Powers of 7: 1.
  2. So 10! = 28 × 34 × 52 × 7.
  3. A factor chooses each exponent independently: 9 × 5 × 3 × 2 = 270 (D).

Why this works: Counting factors only needs the exponents of the prime factorisation: add one to each and multiply.

Where it leads: Numbers with lots of factors for their size are called highly composite; Ramanujan studied them. 720720 has 240 factors.

Strategy: Organised cases

Problem I50

Number theoryShort answer

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

Hint

List numbers that leave remainder 4 on division by 7, then test them.

Second hint

4, 11, 18, 25, 32, 39, 46, 53, … Which leave remainder 3 on division by 5?

Full worked solution

Answer: 53

  1. Numbers leaving remainder 4 on division by 7: 4, 11, 18, 25, 32, 39, 46, 53, …
  2. Of these, remainder 3 on division by 5: 18 and then every 35 more: 18, 53, 88, …
  3. Remainder 2 on division by 3: 18 leaves 0; 53 = 51 + 2 leaves 2. ✓
  4. The answer is 53.

Why this works: Satisfying one condition at a time, and noting that solutions repeat every product of the divisors so far, keeps the search short.

Where it leads: The Chinese remainder theorem says there is exactly one solution below 3 × 5 × 7 = 105 because 3, 5 and 7 have no common factors.

Strategy: Organised cases

Problem I51

Number theoryShort answer

How many whole numbers from 1 to 1000 have no common factor with 1000 other than 1?

Hint

1000 = 23 × 53. A number shares a factor with 1000 exactly when it is even or a multiple of 5.

Second hint

Count the numbers that are neither even nor a multiple of 5.

Full worked solution

Answer: 400

  1. A number shares a factor with 1000 = 2353 exactly when it is divisible by 2 or by 5.
  2. Divisible by 2: 500. By 5: 200. By both (by 10): 100. So by 2 or 5: 500 + 200 − 100 = 600.
  3. The rest: 1000 − 600 = 400.

Why this works: Inclusion–exclusion over the prime factors of 1000 counts the numbers that share a factor, and the complement gives the answer.

Where it leads: This count is Euler’s totient φ(1000) = 1000 × (1 − 1/2)(1 − 1/5). It is the key number in RSA encryption.

Strategy: Count the opposite

Problem I52

Number theoryMultiple choice

The five-digit number 4d7d2 (where both d’s are the same digit) is divisible by 11. What is d?

Hint

A number is divisible by 11 when the alternating sum of its digits is.

Second hint

4 − d + 7 − d + 2 = 13 − 2d.

Full worked solution

Answer: A, 1

  1. Divisibility by 11: the alternating digit sum 4 − d + 7 − d + 2 = 13 − 2d must be a multiple of 11.
  2. For a digit d (0 to 9), 13 − 2d ranges from −5 to 13, so it must be 0 or 11.
  3. 13 − 2d = 11 gives d = 1; 13 − 2d = 0 has no whole-number solution.
  4. So d = 1 (A): 41712 = 11 × 3792. ✓

Why this works: 10 leaves remainder −1 on division by 11, so the digits contribute with alternating signs.

Where it leads: Similar tests exist for 7 and 13 using 1001 = 7 × 11 × 13: split the number into blocks of three digits and alternate signs.

Strategy: Parity and remainders, Organised cases

Problem I53

Number theoryShort answer

Two positive whole numbers have highest common factor 12 and product 5184. How many such pairs are there? (Count {a, b} and {b, a} as the same pair.)

Hint

Write the numbers as 12x and 12y. What do you know about x and y?

Second hint

xy = 5184 ÷ 144 = 36, and x and y have no common factor.

Full worked solution

Answer: 2

  1. Write a = 12x and b = 12y, where x and y share no common factor (otherwise the HCF would be bigger).
  2. ab = 144xy = 5184, so xy = 36.
  3. Split 36 = 22 × 32 into two coprime parts: each prime power must go entirely to one side: {1, 36} and {4, 9}.
  4. So the pairs are {12, 432} and {48, 108}: 2 pairs.

Why this works: Dividing out the HCF leaves two coprime numbers, and coprime numbers cannot share any prime, so each prime power goes to one side.

Where it leads: A number with k different prime factors splits into 2k−1 unordered coprime pairs. Coprime splitting is key in problems about squares and Pythagorean triples.

Strategy: Organised cases, Proof techniques

Problem I54

Number theoryShort answer

What is the smallest positive whole number whose square ends in the digits 444?

Hint

The square ends in 4, so the number ends in 2 or 8. Then think about the last two digits.

Second hint

Work out which endings give squares ending in 44. Then try to extend to 444.

Full worked solution

Answer: 38

  1. A square ends in 4 only if the number ends in 2 or 8.
  2. Squares ending in 44: checking endings 02, 08, 12, …, the numbers ending in 12, 38, 62, 88 work (e.g. 122 = 144, 382 = 1444).
  3. Try the smallest candidates: 122 = 144 (ends 144, not 444); 382 = 1444 (ends 444). ✓
  4. The answer is 38.

Why this works: Building the ending one digit at a time (last digit, then last two) cuts a big search down to a handful of candidates.

Where it leads: No square ends in 4444: squares ending in 44 have the form 100k + 44 with restrictions mod 16. Working modulo powers of 10 one digit at a time is called Hensel lifting.

Strategy: Organised cases, Working backwards

Problem I55

Number theoryShort answer

How many perfect squares (including 1) divide 24 × 35 × 52?

Hint

A square factor has an even exponent for each prime.

Second hint

Exponent of 2: 0, 2 or 4. Of 3: 0, 2 or 4. Of 5: 0 or 2.

Full worked solution

Answer: 18

  1. A factor 2a3b5c is a square exactly when a, b and c are all even.
  2. a ∈ {0, 2, 4}: 3 choices. b ∈ {0, 2, 4} (b ≤ 5): 3 choices. c ∈ {0, 2}: 2 choices.
  3. Total: 3 × 3 × 2 = 18.

Why this works: Squares are recognised prime by prime, so the choices for each exponent multiply.

Where it leads: The number of square factors of n equals the number of factors of the largest square dividing n’s ‘square root part’. Try counting cube factors the same way.

Strategy: Organised cases

Problem I56

Number theoryMultiple choice

How many of the whole numbers 1, 2, 3, …, 99 can be written as the difference of two squares of whole numbers (a2 − b2, with 0 allowed)?

Hint

a2 − b2 = (a − b)(a + b). What can you say about the parity of the two brackets?

Second hint

a − b and a + b are both odd or both even. So the product is odd or a multiple of 4.

Full worked solution

Answer: D, 74

  1. a2 − b2 = (a − b)(a + b), and the two brackets differ by 2b, so they are both odd or both even.
  2. Both odd: the product is odd. Both even: the product is a multiple of 4. So numbers leaving remainder 2 on division by 4 are impossible.
  3. Every other number works: odd n = 2k + 1 = (k + 1)2 − k2; n = 4k = (k + 1)2 − (k − 1)2.
  4. From 1 to 99 there are 25 numbers of the form 4k + 2 (2, 6, …, 98), so 99 − 25 = 74 (D).

Why this works: Factorising a difference of squares and looking at parity both rules out a whole class and shows how to build every other number.

Where it leads: Sums of two squares are subtler: n is a sum of two squares exactly when every prime of the form 4k + 3 appears to an even power (Fermat and Euler).

Strategy: Parity and remainders, Proof techniques

Problem I57

Number theoryShort answer

What is the 2026th digit after the decimal point in the decimal expansion of 1/7?

Hint

1/7 = 0.142857142857…

Second hint

The block 142857 repeats every 6 digits. Divide 2026 by 6.

Full worked solution

Answer: 8

  1. 1/7 = 0.142857 repeating, with period 6.
  2. 2026 = 6 × 337 + 4, so the 2026th digit is the 4th digit of the block.
  3. The block is 1, 4, 2, 8, 5, 7, so the 4th digit is 8.

Why this works: A repeating decimal is periodic, so only the remainder on division by the period matters.

Where it leads: 1/p has period dividing p − 1 for primes p other than 2 and 5. The period is p − 1 exactly when 10 is a ‘primitive root’ mod p (7, 17, 19, 23, …).

Strategy: Spot the pattern and generalise

Problem I58

Number theoryShort answer

When 2026 is written in base 3, what is the sum of its digits?

Hint

Powers of 3: 1, 3, 9, 27, 81, 243, 729.

Second hint

2026 = 2 × 729 + 568, and keep going with 243.

Full worked solution

Answer: 6

  1. 2026 = 2 × 729 + 568. 568 = 2 × 243 + 82. 82 = 1 × 81 + 1. 1 = 0 × 27 + 0 × 9 + 0 × 3 + 1.
  2. So 2026 in base 3 is 2210001.
  3. Digit sum: 2 + 2 + 1 + 0 + 0 + 0 + 1 = 6.

Why this works: Converting to base 3 means taking out the largest powers of 3 greedily, just as in base 10.

Where it leads: The base-3 digit sum also tells you the power of 3 in 2026!: it is (2026 − 6)/2 = 1010.

Strategy: Working backwards

Problem I59

Number theoryShort answer

For how many positive whole numbers n is (n + 12)/(n − 3) a whole number?

Hint

Write the fraction as 1 + something.

Second hint

(n + 12)/(n − 3) = 1 + 15/(n − 3). So n − 3 divides 15 (and can be negative).

Full worked solution

Answer: 5

  1. (n + 12)/(n − 3) = 1 + 15/(n − 3), so n − 3 must divide 15.
  2. n − 3 ∈ {1, 3, 5, 15, −1, −3, −5, −15}, giving n = 4, 6, 8, 18, 2, 0, −2, −12.
  3. Positive values: 2, 4, 6, 8, 18: 5 numbers.

Why this works: Splitting off the whole-number part leaves a simple fraction whose denominator must divide its numerator. Remember negative divisors.

Where it leads: The same trick handles any (n + a)/(n + b): it is 1 + (a − b)/(n + b), so the number of solutions is controlled by the divisors of a − b.

Strategy: Organised cases

Problem I60

Number theoryMultiple choice

p and q are prime numbers with p2 − 2q2 = 1. What is p + q?

Hint

Is p odd or even?

Second hint

p2 = 2q2 + 1 is odd, so p is odd. Then (p − 1)(p + 1) = 2q2.

Full worked solution

Answer: A, 5

  1. p2 = 2q2 + 1 is odd, so p is odd, and p2 − 1 = (p − 1)(p + 1) is a product of two consecutive even numbers, so a multiple of 8.
  2. So 2q2 is a multiple of 8, so q2 is a multiple of 4, so q is even: q = 2.
  3. Then p2 = 9 and p = 3, which is prime.
  4. p + q = 5 (A).

Why this works: Parity, pushed one step further (multiples of 8), forces q to be the only even prime.

Where it leads: Without the prime condition, x2 − 2y2 = 1 has infinitely many solutions (3, 2), (17, 12), (99, 70), …: Pell’s equation, whose solutions approximate √2.

Strategy: Parity and remainders, Proof techniques

Problem I61

Number theoryShort answer

The triangle numbers are Tn = 1 + 2 + … + n = n(n + 1)/2. How many of T1, T2, …, T100 are even?

Hint

Work out whether T1, T2, …, T8 are odd or even. What pattern do you see?

Second hint

Tn is even when n(n + 1) is a multiple of 4, i.e. n leaves remainder 0 or 3 on division by 4.

Full worked solution

Answer: 50

  1. Tn = n(n + 1)/2 is even exactly when n(n + 1) is a multiple of 4.
  2. One of n, n + 1 is odd, so the other must be a multiple of 4: n ≡ 0 or 3 (mod 4).
  3. The parities go odd, odd, even, even, odd, odd, even, even, … (period 4).
  4. In 1 to 100 there are 25 complete blocks of 4, each with 2 even values: 50.

Why this works: Parity of a product of consecutive numbers depends only on n modulo 4, giving a repeating pattern.

Where it leads: Which triangle numbers are multiples of 3, or perfect squares? The square ones (1, 36, 1225, …) are linked to Pell’s equation again.

Strategy: Spot the pattern and generalise, Parity and remainders

Keep going

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

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

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