🔢
CMS Math Olympiad · 6th Grade

Number Theory and Digits

Divisibility, prime numbers, digits, and their secrets. Numbers hide beautiful patterns — let’s uncover them.

1
Divisibility

The number \(a\) is divisible by \(b\) if the remainder after dividing \(a \div b\) is zero. For example, 12 is divisible by 3 because \(12 \div 3 = 4\) (with no remainder).

Remember these divisibility tests — they save time in olympiads:

Divisible byRuleExample
2The last digit is even (0, 2, 4, 6, 8)374 → 4 is even ✓
3The sum of the digits is divisible by 3528 → 5+2+8 = 15 ✓
4The last two digits form a number divisible by 41 316 → 16 ÷ 4 = 4 ✓
5The last digit is 0 or 52 735 → 5 ✓
6Divisible by both 2 and 3354 → even + (3+5+4=12) ✓
9The sum of the digits is divisible by 9729 → 7+2+9 = 18 ✓
10The last digit of 01 530 → 0 ✓
11The difference of the alternating digit sums is divisible by 112 574 → (2+7)−(5+4) = 0 ✓
Main rule
Tests for 3 and 9 are the most common in olympiads. Just add the digits and see whether the sum is divisible.
Try it
The number 4,572 is divisible by:
· · ·
2
Prime numbers

A prime number is a number greater than 1 that is divisible only by 1 and itself.

The first primes are: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47…

Take note
2 is the only even prime. All other even numbers are divisible by 2, so they cannot be prime.
1 is NOT a prime number (by definition).

Prime numbers from 1 to 50 (highlighted in blue):

How do you test whether a number is prime?
To test a number \(n\), try dividing it by all prime numbers from 2 up to \(\sqrt{n}\).

Example: Is 37 prime?
\(\sqrt{37} \approx 6.1\). Check: 37 ÷ 2 ✗, 37 ÷ 3 ✗, 37 ÷ 5 ✗. None works → 37 is prime.
Test problem — Q20

How many prime numbers are there between 30 and 50?

Check each one: 31 ✓, 32 ✗, 33 ✗, 34 ✗, 35 ✗, 36 ✗, 37 ✓, 38 ✗, 39 ✗, 40 ✗, 41 ✓, 42 ✗, 43 ✓, 44 ✗, 45 ✗, 46 ✗, 47 ✓, 48 ✗, 49 ✗.

Answer: 5 (they are 31, 37, 41, 43, 47).

Try it
How many prime numbers are there between 10 and 30?
· · ·
3
GCD and LCM

GCD (greatest common divisor) — the largest number that divides both numbers.

LCM (least common multiple) — the smallest number divisible by both numbers.

How to find the GCD — the simple way

Let us find GCD(18, 24).

Divisors of 18: 1, 2, 3, 6, 9, 18

Divisors of 24: 1, 2, 3, 4, 6, 8, 12, 24

Common divisors: 1, 2, 3, 6The largest one → GCD = 6.

How to find the LCM — the simple way

Let us find LCM(12, 15).

Multiples of 12: 12, 24, 36, 48, 60, 72…

Multiples of 15: 15, 30, 45, 60, 75…

The first common one → LCM = 60.

Hint
For small numbers, the fastest way is just to list divisors or multiples. No complicated formulas are needed!
Try it
GCD(18, 24) equals:
Try it
LCM(12, 15) equals:
· · ·
4
Digits of a number

A two-digit number with digits \(a\) (tens) and \(b\) (ones) can be written as:

Writing a number using its digits
\(\overline{ab} = 10a + b\)
Reversed number: \(\overline{ba} = 10b + a\)
Difference: \(\overline{ab} - \overline{ba} = 9(a - b)\)
Nice fact
The difference between a two-digit number and its reversed number is always divisible by 9For example: \(84 - 48 = 36 = 9 \times 4\).
Test problem — Q21

The sum of the digits of a two-digit number is 12. If the digits are swapped, the new number is 36 less than the original. What is the number?

Let the number be \(\overline{ab}\). Then:

\(a + b = 12\)

\(\overline{ab} - \overline{ba} = 36\), so \(9(a-b) = 36\), hence \(a - b = 4\).

From the system: \(a + b = 12\) and \(a - b = 4\) → \(a = 8\), \(b = 4\).

Answer: 84.

Try it
The sum of the digits of a two-digit number is 10. If the digits are swapped, the new number is 54 less. What is the original number?
\(a + b = 10\) and \(9(a - b) = 54 \Rightarrow a - b = 6\).
\(a = 8, b = 2\). The number is: 82.
Try it
The three-digit number \(\overline{3a7}\) is divisible by 9. Digit \(a\) equals:
· · ·
5
The last digit of a power

This is a favourite CMS topic! The last digit of powers . repeats in cycles. You only need to find the cycle.

Base\(n=1\)\(n=2\)\(n=3\)\(n=4\)Cycle
224862, 4, 8, 6 (length 4)
339713, 9, 7, 1 (length 4)
446464, 6 (length 2)
779317, 9, 3, 1 (length 4)
884268, 4, 2, 6 (length 4)
991919, 1 (length 2)
Algorithm
1. Find the cycle of last digits for the given base.
2. Divide the exponent by the cycle length.
3. The remainder tells you the position in the cycle. (Remainder 0 = the last position.)
Test problem — Q22

The last digit of \(7^{100}\) equals:

Cycle for 7: 7, 9, 3, 1 (length 4).

\(100 \div 4 = 25\) (remainder 0).

Remainder 0 → the last position in the cycle → 1.

Try it
The last digit of \(3^{2025}\) equals:
Cycle for 3: 3, 9, 7, 1 (length 4).
\(2025 \div 4 = 506\) with remainder \(1\).
Remainder 1 → first position → 3.
Try it
The last digit of \(2^{50}\) equals:
Cycle for 2: 2, 4, 8, 6 (length 4).
\(50 \div 4 = 12\) with remainder \(2\).
Remainder 2 → second position → 4.
· · ·
6
Remainders

When \(17 \div 5 = 3\) with remainder \(2\), we write: \(17 = 5 \times 3 + 2\).

A remainder is what is “left over.” It is always smaller than the divisor.

Main properties of remainders
Remainder of a sum = the sum of the remainders (then take the remainder again)
Remainder of a product = the product of the remainders (then take the remainder again)

Example: the remainder of \(23 + 19\) when divided by 7:
\(23 = 7 \times 3 + \mathbf{2}\), \(19 = 7 \times 2 + \mathbf{5}\)
Remainder of a sum: \(2 + 5 = 7\). But \(7 \div 7 = 1\) with remainder 0.
Example — remainder of a large number

What is the remainder when \(176543 + 92841\) is divided by 4?

For divisibility by 4, it is enough to look at the last two digits:

\(176543\): the last two digits are 43. \(43 \div 4 = 10\) with remainder 3.

\(92841\): the last two digits are 41. \(41 \div 4 = 10\) with remainder 1.

Remainder of a sum: \(3 + 1 = 4\). \(4 \div 4 = 1\) with remainder 0.

Try it
The remainder when dividing \(2^{10}\) by 7 is:
\(2^{10} = 1024\). \(1024 \div 7 = 146\) with remainder \(1024 - 146 \times 7 = 1024 - 1022 = 2\).

Answer: remainder 2.
· · ·
7
Olympiad practice
Problem 1 · Easy
How many divisors does 36 have?
We simply list all divisors of 36:
1, 2, 3, 4, 6, 9, 12, 18, 36.

Count them: 9 divisors.

Hint: look in pairs — \(1 \times 36\), \(2 \times 18\), \(3 \times 12\), \(4 \times 9\), \(6 \times 6\). This way you will not miss anything.
Problem 2 · Easy
How many integers from 1 to 60 are divisible by 3 or 5?
Count separately:
Divisible by 3: from 3 to 60 in steps of 3 → 20 numbers.
Divisible by 5: from 5 to 60 in steps of 5 → 12 numbers.

But some are divisible by both 3 and 5 (that is, by 15) — we counted those twice.
Divisible by 15: from 15 to 60 in steps of 15 → 4 numbers (15, 30, 45, 60).

Answer: \(20 + 12 - 4 = \mathbf{28}\).
Problem 3 · Medium
The last digit of \(5^{2025} - 3^{2024}\) equals:
\(5^n\) always ends in 5 (for \(n \geq 1\)).

For \(3^{2024}\): cycle 3, 9, 7, 1 (length 4). \(2024 \div 4 = 506\), remainder 0 → last position → 1.

\(5 - 1 = \mathbf{4}\).
Problem 4 · Medium
The three-digit number \(\overline{2a3}\) is divisible by 9. Digit \(a\) equals:
Sum of digits: \(2 + a + 3 = 5 + a\).
For divisibility by 9, \(5 + a\) must be divisible by 9.
\(5 + 4 = 9\) ✓. Check: \(243 \div 9 = 27\) ✓.
Answer: \(a = \mathbf{4}\).
Problem 5 · Medium
What is the sum of the prime divisors of 60?
Let us factor 60 into primes:
\(60 = 2 \times 2 \times 3 \times 5\)

Prime divisors (without repetition): 2, 3, 5.
Sum: \(2 + 3 + 5 = \mathbf{10}\).
Problem 6 · Medium+
The remainder when dividing \(2024^{2024} \times 2024^{2025}\) by 2024 equals:
\(2024^{2024} \times 2024^{2025} = 2024^{4049}\).
Since the exponent is \(\geq 1\), this number is divisible by 2024.
Remainder = 0.
Problem 7 · Medium+
How many divisors of 48 are greater than 3?
All divisors of 48: 1, 2, 3, 4, 6, 8, 12, 16, 24, 48.

Greater than 3: 4, 6, 8, 12, 16, 24, 487 divisors.

Hint: search in pairs — \(1 \times 48\), \(2 \times 24\), \(3 \times 16\), \(4 \times 12\), \(6 \times 8\).
Cheat sheet — Number Theory
Divisibility by 3: the sum of the digits is divisible by 3
Divisibility by 9: the sum of the digits is divisible by 9
Divisibility by 4: the last 2 digits form a number divisible by 4
Divisibility by 11: the difference of alternating digit sums
A prime number: is divisible only by 1 and itself
GCD: greatest common divisor — list common divisors
LCM: least common multiple — list multiples
Two-digit number: \(\overline{ab} = 10a + b\), difference with the reversed number = \(9(a-b)\)
The last digit of a power: find the cycle → divide the exponent by the cycle length
Remainder of a sum: sum of remainders (then take the remainder again)
Divisors: look in pairs — \(1 \times n\), \(2 \times ?\), \(3 \times ?\)…

Navigation