১২টি ছোট ভিডিও
The most basic building blocks of number theory are the prime numbers. Every whole number greater than is built by multiplying primes. In BdMO Junior, more than one problem comes from this topic almost every year.
In this sheet you will learn, step by step: testing for primes, parity arguments, prime factorisation, the number of divisors, recognising perfect squares and cubes, and solving prime equations with the difference of squares.
First, let us be clear about what a factor (divisor) is: the number is a factor of if dividing by leaves remainder . For example, the factors of are — 6 in total.
Every always has at least two factors: and itself. This gives the definitions:
If we counted as prime, then — the factorisation would no longer be unique.
is the only even prime. Any other even number has at least 3 factors: , and itself. This little fact is the most useful weapon in this topic — you will see it in Section 3.
Suppose is composite. Then we can write where . If both were bigger than , then — impossible. So the smaller one has . And any prime factor of also divides . Conclusion:
To check whether is prime, just try dividing by the primes up to . If none of them divides it, is prime.
Example 1. Is prime? and , so lies between and . We only need to check .
So is prime.
Example 2. Composites "in disguise": , , , , .
| Divisor | When it divides |
|---|---|
| last digit is even | |
| the digit sum is a multiple of | |
| last digit is or |
Every prime greater than has the form or (, , , are all multiples of or ).
To get all primes up to : keep and cross out its multiples, then do the same with , and so on with the primes up to . Whatever survives is prime.
Remember: there are 4, 9, 15 and 25 primes up to , , and respectively.
. A prime divides this product exactly when . Why? If , then itself is one of the factors in the product; and if a prime divides a product, it divides one of the factors, which is impossible when .
Example 3. What is the largest prime factor of ? Go down from : are out, is prime. Answer: . And the smallest prime that does not divide is .
Twist: if you need " divides", then there must be at least two multiples of ( and ) between and , that is, . For example, if divides , the largest possible value is .
Problems that use this: Problem 5 (Solutions Part 1), Problem 2 (Solutions Part 1), Problem 11 (Solutions Part 2).
Rules for adding odd numbers:
Every prime except is odd. So when you are given the sum of some primes, count how many primes there are, and check whether the sum is even or odd. If it does not match, must be in the list.
Example 4. The difference of two primes is . What are the two numbers? The difference of two odd numbers is even, but is odd. So the smaller one is and the larger one is .
Example 5. The sum of three primes is (even). The sum of three odd numbers would be odd, so one of them must be , and the other two add up to .
Any positive power of an even number is even, and any power of an odd number is odd. In other words, if , then and have the same parity. For example, = odd + even = odd — no need to work out the huge number at all.
One more useful fact: is always even, because one of two consecutive numbers is even. So is always odd.
Problems that use this: Problem 6 (Solutions Part 1), Problem 1 (Solutions Part 1), Problem 7 (Solutions Part 1), Problem 14 (Solutions Part 2), Problem 10 (Solutions Part 2), Problem 15 (Solutions Part 3).
In Problem 7 (Solutions Part 1), if Rakib is older than both of the others and the ages are under , the answer is ; if the younger brother may be the same age as Rakib, it is , and if years is also allowed, it is . The MCQ states the first condition.
The fundamental theorem of arithmetic: every whole number greater than can be written as a product of prime numbers, and apart from the order, this way of writing it is unique.
Keep breaking each composite piece into two smaller numbers; at some point every piece is prime and you stop — this is the factor tree:
How to break it down: start with the smallest prime, divide as long as it goes, then move to the next prime. Once the prime you are testing is bigger than the square root of the remaining quotient (and the quotient is not ), what is left is itself prime.
Example 6. The product of three different primes is . What is their sum? is odd and not divisible by or ; , and . The factorisation is unique, so the three primes are definitely — their sum is . No guessing needed.
If a process keeps multiplying by and , count how many times each one happens; the result will be . In a process that alternates, take one full round as a unit: "double, then triple" = per round.
If , then must be a common factor of the exponents of all the primes in . For example, in , taking gives . If a range for is given, that range fixes .
When a question gives "a multiple of such-and-such", "the sum of the prime factors" and "exactly factors" together, use each condition for a different job: the multiple condition tells you which primes are definitely there, the sum of the primes tells you which other primes are there (each prime is added only once, however big its exponent), and the number of divisors fixes the exponents (next section).
Problems that use this: Problem 4 (Solutions Part 1), Problem 16 (Solutions Part 3), Problem 18 (Solutions Part 3).
Every divisor of looks like , where can be (3 choices) and can be (2 choices). In the grid below, each cell is one divisor:
That is divisors in total. It is because the exponent starts from that we add to each exponent. In general:
From this: if , the only way is (a prime); if , then (the square of a prime). And divisors come in pairs ( and ), so is odd only for perfect squares.
Example 7. , so .
The reverse question: what is the smallest number with exactly divisors? Method:
Step 1. Write as a product of factors (each greater than ) in every possible way.
Step 2. Subtract from each factor to get the exponents. Sort the exponents from largest to smallest and give the largest exponent to the smallest prime (, then , then …).
Step 3. Compare all the candidates and take the smallest. Do not stop after looking at just one way of splitting.
Example 8. The smallest number with exactly divisors:
| Splitting | Exponents | Candidate |
|---|---|---|
Answer: . If the condition changes (for example "an odd number"), use the same table, but start the primes from .
Problems that use this: Problem 8 (Solutions Part 2), Problem 12 (Solutions Part 2), Problem 17 (Solutions Part 3), Problem 18 (Solutions Part 3).
In Problem 8 (Solutions Part 2), if you read (so ), the number is with factors; if you read , it is with factors. The MCQ states .
In the factorisation of , the exponent of each prime is double its exponent in . So:
A number is a perfect square exactly when the exponent of every prime in it is even; a perfect cube exactly when every exponent is a multiple of ; and a -th power when every exponent is a multiple of .
Example 9. If is a perfect cube, what is the smallest ? . To bring the exponents up to we need another and , so and .
How many divisors of are perfect squares? For a divisor to be a perfect square, every exponent must be even:
That is in total. General rule: if the exponent is , a multiple of can be chosen in ways. Do not forget exponent — itself is a perfect square and a perfect cube. "Both a square and a cube" means the exponents are multiples of .
For expressions like and (the same letters, exponents swapped), multiply them: . So if one is a cube, the other must be a cube too.
Problems that use this: Problem 13 (Solutions Part 2), Problem 19 (Solutions Part 3), Problem 16 (Solutions Part 3).
In Problem 19 (Solutions Part 3), if you want an that is guaranteed for every , the answer is ; if you read it as "can be" for some single pair, every is possible () and there is no single answer. The MCQ says "for certain".
The most useful formula for equations with prime numbers:
Why is it so useful? A prime number (or a power of a prime) has very few divisors. If is prime, the only way to write as a product of two positive numbers is ; only as or ; as or . So when one side is a prime power, there is almost only one pair of factors — the equation solves itself.
Example 10. For which whole number is prime? . For it to be prime, the smaller factor must be : , that is , and then , which really is prime. The only answer is .
Example 11. , are primes and . Rearrange: .
A number close to a perfect square also breaks up this way: .
Problems that use this: Problem 20 (Solutions Part 3), Problem 15 (Solutions Part 3), Problem 11 (Solutions Part 2).
To see whether an expression can be prime, do not work out every value — look at the remainder when dividing by (or ). For any that is not a multiple of , leaves remainder when divided by (because and are both more than a multiple of ).
Example 12. For which prime is also prime? If , then leaves remainder , that is , when divided by — the expression is a multiple of and bigger than , so it is composite. The only possibility is : , prime ✓.
If you are given a small set (for example "the absolute value of is a one-digit prime"), make a table of all the values — both positive and negative; the remainder sieve only cuts down the work.
Problems that use this: Problem 10 (Solutions Part 2).
Olympiads often give a new name or a strange rule ("a perfect number for this question", "on Jupiter is also prime"). Do not panic — first ask: what familiar thing is this definition really?
From to there are multiples of . A common multiple of two numbers means a multiple of their LCM ( for and , not their product ).
Example 13. From to , how many numbers are divisible by exactly one of and (one of them, not both)? There are multiples of , of and of . Answer: .
To identify a number from questions like "Is it divisible by ?", you need to know the exponent of each prime. Notice the rule: all the questions must be asked together first, and the answers come afterwards (this is the rule in the puzzle of Problem 21 (Solutions Part 3)). The only question that tells apart from is "Is it divisible by ?" — so to identify any number from to you need exactly as many questions as there are prime powers up to . (If you could choose the next question after hearing an answer, fewer questions would do, but that is a different puzzle.)
Example 14. The prime powers up to : — 12 of them. So if the questions must all be asked together, you need 12 questions to identify any number from to , no fewer.
Problems that use this: Problem 3 (Solutions Part 1), Problem 9 (Solutions Part 2), Problem 21 (Solutions Part 3).
In Problem 9 (Solutions Part 2), if each prime divisor is counted once, the answer is ; if they are counted with repetition, the answer on Jupiter is not fixed, and if you read just "factors", it is . The MCQ says "each counted once".
In Problem 21 (Solutions Part 3), if the number is between and , the largest possible value is ; with no limit at all, and give the same answers, so no number can be identified for certain. The MCQ says " to ".
In past years these have come up again and again in this topic: sums of primes and parity (in almost every Regional round), the smallest number with "exactly divisors" (both in 2023 and 2026), and the difference of squares in prime equations (2024). When you see these clues in a question, here is the technique to reach for:
| What you see in the question | Technique to use |
|---|---|
| Sum or difference of some primes, especially odd | Parity → one prime is (Section 3) |
| "The sum is even", but with huge powers | and have the same parity (Section 3) |
| The product of some primes is given | Prime factorisation — the answer is unique (Section 4) |
| "Exactly two / three factors" | Prime / square of a prime (Sections 1, 5) |
| "How many divisors", "smallest with exactly divisors" | , compare all splittings (Section 5) |
| Perfect square / perfect cube / -th power | Every prime's exponent is a multiple of (Section 6) |
| "Write in the form " | Common factor of the exponents = (Section 4) |
| Primes + an equation, , | Difference of squares + "Is one of them ?" (Section 7) |
| Largest prime factor of | The largest prime less than or equal to (Section 2) |
| The expression is prime, from a small set | Table + remainder on division by (Section 8) |
| A new name, a strange rule | Translate into a familiar idea (Section 9) |
| "Is it divisible?" yes/no questions | Count the prime powers (Section 9) |
Build the habit: as soon as you see the word "prime", ask — "Is in here?" and "What does the prime factorisation show?"